[Paper Review] An Algorithm for Routing Vectors in Sequences
This paper introduces a highly optimized routing algorithm that computes output vectors from input sequences by maximizing 'bang per bit'—the net benefit of using data versus the cost of ignoring it. The method uses four differentiable neural networks to enable end-to-end credit assignment, achieving state-of-the-art accuracy on NLP and vision tasks while reducing memory and computation by orders of magnitude through parameter sharing, lazy evaluation, and tensor contraction optimizations.
We propose a routing algorithm that takes a sequence of vectors and computes a new sequence with specified length and vector size. Each output vector maximizes "bang per bit," the difference between a net benefit to use and net cost to ignore data, by better predicting the input vectors. We describe output vectors as geometric objects, as latent variables that assign credit, as query states in a model of associative memory, and as agents in a model of a Society of Mind. We implement the algorithm with optimizations that reduce parameter count, computation, and memory use by orders of magnitude, enabling us to route sequences of greater length than previously possible. We evaluate our implementation on natural language and visual classification tasks, obtaining competitive or state-of-the-art accuracy and end-to-end credit assignments that are interpretable.
Motivation & Objective
- To address the credit assignment problem in deep learning by enabling interpretable attribution of model decisions to input components.
- To scale routing algorithms to long sequences (up to 1 million vectors) by reducing computational and memory complexity.
- To unify multiple theoretical perspectives—geometric, latent variable, associative memory, and Society of Mind—into a single routing framework.
- To implement a routing system that supports competitive performance on large-scale NLP and vision benchmarks with minimal computational overhead.
- To provide a fully interpretable, differentiable routing mechanism with end-to-end credit assignments for model analysis and debugging.
Proposed method
- The algorithm uses four neural networks: $\mathcal{A}$ for input activation scores, $\mathcal{F}$ for generating proposed output vectors from inputs, $\mathcal{G}$ for predicting inputs from outputs, and $\mathcal{S}$ for scoring agreement between predictions and actual inputs.
- Output vectors are updated iteratively in parallel by maximizing 'bang per bit,' defined as the difference between net benefit of using data and net cost of ignoring it.
- The network $\mathcal{F}$ is optimized as a composition of a scaled tensor product and linear transformation with positionwise biases, drastically reducing parameter count.
- Lazy evaluation of $\mathcal{F}$'s output avoids storing intermediate values, reducing memory use by orders of magnitude.
- The computation of updated output states is decomposed into efficient tensor contractions, minimizing both memory and computation.
- The method supports linear scaling in input length, vector size, number of output vectors, and output size, enabling control over resource usage.
Experimental results
Research questions
- RQ1Can a routing algorithm be designed to scale to long sequences (e.g., 1 million vectors) while maintaining low memory and computation?
- RQ2Can 'bang per bit' optimization lead to better predictive performance and more interpretable credit assignment in deep networks?
- RQ3How can routing be unified across geometric, latent variable, associative memory, and multi-agent system perspectives?
- RQ4Can the routing mechanism achieve state-of-the-art accuracy on large-scale NLP and vision benchmarks while enabling end-to-end credit assignment?
- RQ5To what extent can computational and memory overhead be reduced through parameter sharing, lazy evaluation, and tensor optimization?
Key findings
- The algorithm successfully routes sequences of up to 1 million vectors, each with 1024 elements, demonstrating scalability beyond previous routing methods.
- On the IMDB sentiment classification task, the method achieves 96.2% accuracy, a new state-of-the-art result.
- For ImageNet-1K classification, the model reaches 86.7% top-1 accuracy using BEiT-large, demonstrating strong performance on vision benchmarks.
- End-to-end credit assignment matrices can be computed with up to 4925 × 1000 elements, enabling fine-grained attribution to subword tokens and image patches.
- The largest credit assignment matrix observed was for a 196-patch image input with 25 Transformer depth levels, showing detailed spatial and hierarchical attribution.
- Credit assignments are interpretable: in vision tasks, attention is assigned to specific body parts (e.g., nose, paws) in deeper layers, while in NLP, sentiment is linked to key phrases across layers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.