---
title: 'RecursiveLink: Residual Module for RecursiveMAS'
url: https://www.emergentmind.com/topics/recursivelink
type: topic
---

# RecursiveLink: Residual Module for RecursiveMAS

RecursiveLink is a lightweight two-layer residual projection module enabling in-distribution latent thought generation and cross-agent latent state transfer in recursive multi-agent systems (RecursiveMAS). It is engineered to align latent distributions both within and among heterogeneous Transformer-based agents while eschewing intermediate text decoding and encoding. RecursiveLink plays a central role in the efficient, stable, and accurate computation underlying recursive collaboration between agents operating entirely in latent space [2604.25917].

## 1. Formalism and Architecture

Each agent in RecursiveMAS incorporates two distinct RecursiveLink modules: an “inner link” dedicated to auto-regressive latent thought generation, and an “outer link” for transferring latent state information to other agents. Let \( h \in \mathbb{R}^{d_h} \) denote a Transformer agent’s last-layer hidden state, and \( H \in \mathbb{R}^{m \times d_h} \) a sequence of latent state vectors across \( m \) steps.

- **Inner RecursiveLink** \( \mathcal{R}_{\text{in}}: \mathbb{R}^{d_h} \rightarrow \mathbb{R}^{d_h} \):

  \[
  \mathcal R_{\rm in}(h) = h + W_2\,\sigma(W_1 h)
  \]

  where \( W_1 \in \mathbb{R}^{d_{\text{mid}} \times d_h} \), \( W_2 \in \mathbb{R}^{d_h \times d_{\text{mid}}} \); \( \sigma \) is GELU. This architecture maintains and refines an agent’s internal latent semantics through direct residual connections.

- **Outer RecursiveLink** \( \mathcal{R}_{\text{out}}: \mathbb{R}^{d_{h_i}} \rightarrow \mathbb{R}^{d_{h_j}} \):

  \[
  \mathcal R_{\rm out}(h) = W_3 h + W_2\,\sigma(W_1 h)
  \]

  Here, \( W_3 \in \mathbb{R}^{d_{h_j} \times d_{h_i}} \) projects agent \( i \)’s hidden state into the input-embedding space of agent \( j \).

This arrangement enables unified latent-space communication, preserving agent-specific features and facilitating heterogeneous agent collaboration without text conversion.

## 2. Latent-space Generation and Agent Coordination

RecursiveLink enables two core operations:

- **In-distribution Latent Thoughts Generation:** Within an agent \( A_i \), after processing tokens up to time \( t \), the next input embedding is produced as

  \[
  e_{t+1} = \mathcal R_{\rm in}(h_t)
  \]

  This process is entirely conducted in continuous latent space, where the agent generates subsequent hidden states auto-regressively.

- **Cross-agent Latent State Transfer:** After agent \( A_i \) produces \( m \) latent vectors \( H_{A_i} \), transfer to agent \( A_j \) is mediated by

  \[
  \widetilde{H}_{A_i} = \mathcal R_{\rm out}(H_{A_i})
  \]

  The resulting embedding block is concatenated to \( A_j \)’s prompt, eliminating the need for expensive and information-destroying text decoding/re-encoding.

A plausible implication is that this methodology fosters both efficiency and fidelity in multi-agent pipelines where heterogeneous architectures and tasks are present.

## 3. Integration with Recursive Multi-Agent Optimization

RecursiveLink is deeply integrated into the recursive loop architecture of RecursiveMAS. The system functions as a single looped transformer chain across \( N \) agents and \( n \) recursion rounds. Each agent sequentially performs in-distribution latent thought generation and receives cross-agent state transfers, updating prompt sequences accordingly.

Training follows a nested inner- and outer-loop structure:

- **Inner-loop (Agent-level):** Minimizes

  \[
  \mathcal L_{\rm in}^i = 1 - \cos\bigl(\mathcal R_{\rm in}^i(H_i),\,\operatorname{Emb}_{\theta_i}(y)\bigr)
  \]

  for each agent, regressing latent thoughts to the ground-truth embedding.

- **Outer-loop (System-level):** The entire system is unrolled for \( n \) recursion rounds, yielding final prediction \( \hat{y} \). The loss is

  \[
  \mathcal L_{\rm out} = \mathrm{CE}(\hat{y}, y)
  \]

  with shared credit assignment via backpropagation through all inner and outer RecursiveLinks.

This structure supports global co-optimization across recursion and agents, assigning credit for both internal reasoning and cross-agent communication.

## 4. Computational Efficiency and Gradient Stability

The module architecture yields notable runtime and optimization benefits. For a vocabulary size \( |V| \), hidden dimension \( d_h \), prompt length \( t \), latent steps \( m \), and agent count \( N \):

- **Text-based Recursive MAS:**

  \[
  \Theta\bigl(N[m\,|V|\,d_h + (t+m)\,d_h^2 + (t+m)^2d_h]\bigr)
  \]

- **RecursiveMAS with RecursiveLink:**

  \[
  \Theta\bigl(N[m\,d_h^2 + (t+m)\,d_h^2 + (t+m)^2d_h]\bigr)
  \]

Because \( d_h \ll |V| \), per-step computational cost is reduced by approximately a factor \( |V| / d_h \).

Gradient stability is mathematically justified: with standard initialization and confident token distributions (entropy \( \le \epsilon \ll 1 \)), the norm of the Jacobian for text-based pathways

\[
\Bigl\|\frac{\partial\mathcal R_{\rm text}}{\partial h}\Bigr\|_2 \le O(\epsilon) \ll 1
\]

vanishes, while the residual pathway maintains

\[
\Bigl\|\frac{\partial\mathcal R}{\partial h}\Bigr\|_2 \ge \Omega\Bigl(1 - \sqrt{\frac{1}{d_h} \ln \frac{1}{\delta}}\Bigr)
\]

ensuring stable gradients through recursion.

## 5. Empirical Performance and Practical Gains

RecursiveLink delivers substantial improvements on empirical benchmarks. Across nine tasks spanning mathematics, science, medicine, search, and code generation, RecursiveMAS with RecursiveLink was evaluated at recursion depths \( r = 1, 2, 3 \), demonstrating the following end-to-end advantages over text-based baselines:

| Recursion Round \( r \) | Accuracy Gain | Speedup Factor | Token Reduction |
|------------------------:|-------------:|---------------:|---------------:|
| 1                       | +3.4%        | ×1.2           | –34.6%         |
| 2                       | +6.0%        | ×1.9           | –65.5%         |
| 3                       | +7.2%        | ×2.4           | –75.6%         |

The average gains are 8.3% in accuracy, 1.2×–2.4× in end-to-end inference speedup, and 34.6%–75.6% reduction in token usage relative to the text-based recursive multi-agent system benchmark [2604.25917].

## 6. Implications and Context in Multi-Agent Systems

RecursiveLink’s latent-space, residual design preserves information across agents and recursion rounds, in contrast with text-mediated communciation approaches that incur high overhead and information loss. A plausible implication is an improved capacity for iterative, distributed reasoning and task-solving, especially in domains requiring complex collaboration or cross-domain semantics between heterogeneous agents. RecursiveLink integrates seamlessly with unified inner-outer loop co-optimization and achieves stable, end-to-end differentiability—a critical feature for scaling multi-agent deep learning systems efficiently.

Source: https://www.emergentmind.com/topics/recursivelink