We consider a gossip-based distributed stochastic approximation scheme wherein processors situated at the nodes of a connected graph perform stochastic approximation algorithms, modified further by an additive interaction term equal to a weighted average of iterates at neighboring nodes along the lines of "gossip" algorithms. We allow these averaging weights to be modulated by the iterates themselves. The main result is a Benaim-type meta-theorem characterizing the possible asymptotic behavior in terms of a limiting o.d.e. In particular, this ensures "consensus," which we further strengthen to a form of "dynamic consensus" which implies that they asymptotically track a single common trajectory belonging to an internally chain transitive invariant set of a common o.d.e. that we characterize. We also consider a situation where this averaging is replaced by a fully nonlinear operation and extend the results to this case, which in particular allows us to handle certain projection schemes.1. Introduction. In [30], Tsitsiklis, Athans, and Bertsekas introduced a novel framework for distributed algorithms, ideally suited for distributed stochastic optimization. This included in particular a distributed stochastic approximation scheme with a decreasing step-size combined with an averaging across the processors to ensure "consensus." There has been a lot of development since on such schemes and related variants; see, e.g., [14], [19], [21], [29], [27], to mention a few representative works. The pure averaging component has seen even more explosive development under the rubric of "gossip" or "consensus" algorithms; see [28] for a survey. Related "second order" dynamics also appears in the literature on flocking of mobile agents [32] and synchonization [33] (see [24] for a survey). In this work, we go a step further in a different direction, viz., to replace the simple (linear) averaging mechanism by a nonlinear operation that subsumes the classical case. Specifically, we consider two distinct cases. The first is what may be considered a state-dependent averaging in which the averaging stochastic matrix is modulated by the current values of the iterates. This adds another layer of complication to the analysis and is well motivated by some applications. We establish a dynamic version of consensus characterizing the possible common trajectories which the component iterations jointly track in a potentially nonconvergent scenario. In the second case, we replace averaging by a fully nonlinear operation satisfying some key hypotheses. Just as consensus in averaging leads to a constant vector in the limit, i.e., convergence to the one-dimensional invariant subspace of stochastic matrices, the nonlinear case leads to convergence to