TextResNet: Decoupling and Routing Optimization Signals in Compound AI Systems via Deep Residual Tuning
Abstract
Textual Gradient-style optimizers (TextGrad) enable gradient-like feedback propagation through compound AI systems. However, they do not work well for deep chains. The root cause of this limitation stems from the Semantic Entanglement problem in these extended workflows. In standard textual backpropagation, feedback signals mix local critiques with upstream contexts, leading to Attribution Ambiguity. To address this challenge, we propose TextResNet, a framework that reformulates the optimization process to achieve precise signal routing via four key innovations. Firstly, in the forward pass, it enforces Additive Semantic Deltas to preserve an Identity Highway for gradient flow. Secondly, in the backward pass, it introduces Semantic Gradient Decomposition via a Semantic Projector to disentangle feedback into causally independent subspaces. Thirdly, it implements Causal Routing, which routes projected signals to their specific components. Finally, it performs Density-Aware Optimization Scheduling to leverage the disentangled signals to dynamically allocate resources to key system bottlenecks. Our results show that TextResNet not only achieves superior performance compared to TextGrad, but also exhibits remarkable stability for agentic tasks in compound AI systems where baselines collapse. Code is available at https://github.com/JeanDiable/TextResNet.
Lay Summary
Modern artificial intelligence (AI) systems are increasingly built from multiple specialized AI agents working together in a chain—for example, one agent searches the web, another summarizes the text, and a third writes the final answer. However, automatically improving these multi-agent systems is highly challenging. When the final answer is incorrect, existing tools struggle to pinpoint which agent made the mistake, resulting in generic feedback that causes the wrong agents to attempt unnecessary fixes. To address this, we developed TextResNet. Inspired by how computer networks manage traffic, TextResNet preserves the original information from each step and uses a helper AI to split error feedback into clean, distinct categories: mistakes caused locally versus those passed down from earlier steps. It then routes targeted feedback only to the agent responsible for the error, while a smart scheduling system focuses optimization efforts on the system's biggest bottlenecks. Our method makes cooperative AI systems significantly more stable and accurate. It also consumes three times fewer computing resources, paving the way for more reliable, cost-efficient, and easily debuggable multi-agent AI applications.