Introduction
For years, the "BERT family" of bidirectional encoders has been the workhorse of industrial NLP for tasks like document classification and information retrieval. Their effectiveness stems from self-attention’s ability to deliver high-quality bidirectional contextualization. However, these models suffer from a well-known "quadratic bottleneck": as the input text gets longer, the computational cost and memory usage grow at a squared rate ($O(N^2)$).
While many linear-time alternatives (like RNNs or State Space Models) have emerged for generative AI decoders, very few have been successfully adapted for the bidirectional, encoder-only paradigm. Avey-B bridges this gap. By reformulating the recently introduced autoregressive Avey architecture, Avey-B offers a compact, high-performance encoder that scales linearly to massive contexts—up to 96k tokens—without exploding the compute budget.
Architectural Innovations
Avey-B breaks a sequence into small "splits" and uses a two-step process: a Ranker identifies the most relevant previous chunks of text, and a Neural Processor contextualizes the current chunk using that retrieved information.
To optimize this for an encoder-only paradigm, the authors introduce three key architectural innovations:
1. Decoupled Parametrization
In the standard Avey model, learned weights and similarity scores were multiplied together. The authors discovered this coupled approach could cause "inversion effects," where a highly relevant token is accidentally suppressed by a negative weight, violating the intuitive rule that more relevant information should contribute more to the representation.
Avey-B fixes this by decoupling the parameters, alternating between Static Layers (fixed learned weights) and Dynamic Layers (pure similarity-based mixing). This ensures that "more similar" always means "more influence" within a dynamic layer.
2. Stability-Oriented Normalization
Instead of using Softmax, which can become unstable in deep networks, Avey-B employs a simple row-wise sum normalization. This technique preserves the sign of the data and maintains healthy gradients throughout training.
3. Neural Compression
To prevent the model from slowing down as it retrieves more chunks, Avey-B uses a linear projection to compress the retrieved context back into a fixed token budget. Because the neural processor operates on these fixed-size splits, its complexity remains effectively linear ($O(N)$).
As detailed in the architectural ablation studies above, the most effective configuration utilizes an interleaved static-to-dynamic layer pattern, row-wise normalization, and surprisingly, a unidirectional ranker.
Performance and Key Results
The Avey-B models (Base and Large) were pretrained on 180 billion tokens from the FineWeb corpus—roughly 11× fewer tokens than ModernBERT—yet achieved remarkable results across standard benchmarks:
- Superior Accuracy: Avey-B Base (165M parameters) consistently outperformed BERT and NeoBERT. It even surpassed much larger Transformer models on Token Classification (CoNLL-2003, OntoNotes, UNER) and Information Retrieval (MLDR, MS MARCO, NQ) tasks. For retrieval, Avey-B’s built-in mechanism for pruning low-relevance splits acts as a natural noise filter, preventing the model from getting distracted by irrelevant document sections.
- Massive Speedups at Scale: At a 96k token context, Avey-B is 3.38× faster than ModernBERT and 11.63× faster than NeoBERT. While the ranker is technically $O(N^2)$, it is so lightweight that the overall model remains significantly faster than Transformers at scale.
- Long-Context Robustness: In synthetic "Needle-in-a-Haystack" (NIAH) tests, Avey-B maintained near-constant accuracy up to 96k tokens. In contrast, ModernBERT and NeoBERT either ran out of memory (OOM) or suffered significant performance degradation beyond their training windows.
Limitations and Future Work
While Avey-B is highly efficient, it currently relies on torch.compile for speed and lacks the handcrafted CUDA or Triton kernels (like FlashAttention) that mature architectures enjoy. Developing these kernels will unlock even greater throughput.
Additionally, while dominant in classification and retrieval, Avey-B slightly lags behind RoBERTa and ModernBERT on specific Question Answering tasks (like ReCoRD), indicating room for improvement in fine-grained span identification. Finally, future research will explore why a unidirectional ranker outperforms a bidirectional one, as current findings suggest "future" context at the ranking stage can sometimes dilute the signal.
Summary updated