Cooperative Learning of Shared Latent Dynamics for Distributed Online Optimization

1Electrical and Computer Engineering, UC Riverside 2Mathematics, UC Riverside

Submitted to L4DC 2027

Networked agents that never share their data learn their common latent dynamics as if the data were pooled, and use them to keep tracking a moving optimum after the measurements stop.

Case study (A) in Webots, played at 2×. Each ground station sees only its own drone, and only until \(t=N\). The stations learn the shared dynamics of the drones' drift with their neighbors and then keep the charging robot (white) near the best position \(x^\star(t)\) (gold beam) without seeing any drone.

Abstract

We study networked agents that must agree on a decision minimizing the sum of their local costs, where each cost contains unmeasurable stochastic parameters that evolve with linear but unknown dynamics shared by all agents. Each agent receives only finitely many noisy gradient measurements and must then keep tracking the moving minimizer. Our scheme reconstructs the parameters from windows of gradients, learns the shared dynamics cooperatively by averaging instrumental-variable moment matrices over the network, and tracks the minimizer by gradient tracking on forecast gradients. We bound the error of every agent in learning the dynamics and in tracking the minimizer, and show that the learning error, and through it the tracking error, decreases with the number of agents. We demonstrate the approach on two case studies.

Explore the simulation

Replay the Webots run in 3D: drag to orbit, click and scroll to zoom, and scrub the timeline. The panels show what the stations know at each step. The chart compares the run, in which the stations learn together, with the same run had each station learned alone.

Method

Each agent runs three layers. Its measurements, parameters and forecasts never leave it: agents exchange only iterates and gradient trackers with their neighbors, plus two \(p\times p\) moment matrices at \(t=N\).

noisy gradients
\(y_i(t),\ t<N\)

agent \(i\)

1Reconstruct

window estimate \(\tilde\theta_i(t)\)

from \(k\) noisy gradients

2Identify

IV moments \(\hat M_0,\hat M_1\)

\(\tau\) consensus rounds \(\to\hat A^{(i)}\)

with the neighbors, once at \(t=N\):
\(\hat M_0,\hat M_1\)

3Track

forecast \(\hat\theta_i(t)\)

gradient tracking on \(x_i,s_i\)

with the neighbors, every step:
\(x_i-\alpha s_i,\ s_i+\gamma_i(t+1)-\gamma_i(t)\)

decision
\(x_i(t)\)

neighbors \(j\in\mathcal N_i\)

1Reconstruct

Estimate \(\theta_i\) from each window of \(k\) noisy gradients.

\(\tilde\theta_i(t)=K_{i,t}\,\bar y_{i,t}\)

2Identify together

Average the IV moments over the network for \(\tau\) rounds.

\(\hat A^{(i)}=\hat M_1^{(i)}(\tau)\,\hat M_0^{(i)}(\tau)^{-1}\)

3Track

Forecast with \(\hat A^{(i)}\) and run gradient tracking.

\(x_i(t+1)=\sum_j W_{ij}\big(x_j(t)-\alpha\,s_j(t)\big)\)

Guarantees

Learning Theorem 2

With \(m\) agents and \(N\) gradients each, for \(N\) large enough and with probability at least \(1-\delta\), every agent satisfies

\[\|\hat A^{(i)}-A\|\le C_A\big(1+\sqrt m\,\sigma^\tau\big)\sqrt{\frac{\log(4m/\delta)}{mN}}+C_W\sqrt m\,\sigma^\tau D_M+C_B\Big(k\|A-I\|+\sqrt{k\operatorname{tr}\bar Q}\Big).\]

The first term is the error of one learner holding all \(mN\) samples. The second vanishes for identical agents and decays geometrically with the number \(\tau\) of consensus rounds (\(\sigma<1\) is the contraction factor of the graph). The third is the bias of estimating a moving parameter over windows of length \(k\).

Tracking Theorem 4

The tracking error of every agent is a network transient that decays geometrically, plus a forecast error that inherits the \(\sqrt m\) gain of learning and converges to the irreducible error of forecasting a stochastic parameter. Cooperation therefore helps most when data are scarce.

Results

A charging cart for patrolling UAVs

Six agencies each fly one patrol UAV over a wildfire site. Station \(i\) receives only the position of UAV \(i\), and only until \(t=N\), and talks only to its two neighbors on the ring. The stations must agree where a wheeled charging robot should be while wind gusts push the UAVs off their routes. Simulated in Webots; 50 Monte Carlo trials, tracking horizon of 200 steps. Lines are medians and bands interquartile ranges; together means \(\tau=3\) consensus rounds, alone \(\tau=0\).

(a) Tracking RMSE versus \(N\).
(b) Identification error \(\|\hat A^{(i)}-A\|_F\): 2.7–3 times lower together, falling from 0.008 to 0.005 as \(N\) grows.
(c) Identical agents, \(N=100\): the error falls as \(1/\sqrt m\) and saturates for \(m\ge16\), where \(\sigma^\tau\) is no longer small.

Decentralized recommendation with regional servers

Eight regional servers agree on boosts for three product genres while their users’ interests drift with shared, unknown dynamics; the costs are logistic, not quadratic. Same trials and horizon. What each user sees.

(a) Tracking RMSE: 24–37% lower together for every \(N\).
(b) Identification error: 4.7–5.9 times lower together.
(c) Consensus rounds \(\tau\) at \(N=100\): 0.141 alone (\(\tau=0\)), 0.024 together (\(\tau=3\)).

Recommendation systems

An online store has shoppers in eight regions, each with its own server that keeps its data private. Together, the servers decide how strongly to promote outdoor, home and tech products as shoppers’ interests change.

  1. Days 0 to 99: watch

    Each server estimates its shoppers’ interests from 100 visits a day.

  2. Day 100: learn together

    The data stop. Servers share small summaries, never shopper data, and learn how interests change.

  3. Days 100 to 299: predict

    With no new data, each server predicts its shoppers’ interests and adjusts the promotion.

How often do shoppers see the best products?

Each shopper sees 8 products. The best list is what the store would show if it knew every region’s current interests. With 30 days of data before the stop:

94%of daily lists are the best ones when the servers learn together
90%when each server learns alone
More data help both; learning together stays ahead, most when data are scarce. Medians of 50 runs; bands show the middle half.

See it for one shopper

Pick a region, a shopper and a day. Red outlines mark products that are not on the best list.

Simulation details

Case study (B) of the paper with simulated shoppers and products; the model, the data and the algorithm are the paper’s. The promotion is the vector of genre boosts \(x\), logit shifts added to every product of a genre. A list is the top 8 of 32 products, ranked by base score, the shopper’s taste and genre affinity, and the genre boost at the shopper’s server; the best list uses the minimizer \(x^\star(t)\). A list counts as best if it holds the same 8 products, in any order. Days \(N+50\) to \(N+199\), 4,000 shoppers, 50 trials per \(N\). In the trial above (the paper’s Figure 3(b)): 93.4% best lists together, 90.6% alone.

(a) Interest forecasts: 25–50% lower RMSE together.
(b) Genre-mix error: 0.27–0.34 pp together, 0.36–0.55 alone.

Together: \(\tau=3\) consensus rounds; alone: \(\tau=0\). Code: recommendation_demo/ in the code download.

Get started

# Webots simulation
open -a Webots-nightly webots_demo/worlds/disaster_response.wbt
cd webots_demo
python3 tools/collect_data.py --N 100 --track 200 --seeds 2026-2045
python3 tools/analyze_runs.py output/runs

# recommendation systems (case study (B) with products and users)
cd recommendation_demo
python3 run_demo.py
python3 run_montecarlo.py --jobs 6

Download code (.zip)

BibTeX

@inproceedings{tripathi2027cooperative,
  title     = {Cooperative Learning of Shared Latent Dynamics
               for Distributed Online Optimization},
  author    = {Tripathi, Shivanshu and Raissi, Maziar},
  booktitle = {Learning for Dynamics and Control},
  year      = {2027},
  note      = {Submitted}
}