Tequila: Trapping-free Ternary Quantization for Large Language Models

Hong Huang, Decheng Wu, Rui Cen, Guanghua Yu, Zonghang Li, Kai Liu, Jianchen Zhu, Peng Chen, Xue Liu, Dapeng Wu

TL;DR

Tequila is a novel ternary quantization method that enables Large Language Models (LLMs) to run on edge devices with near-original accuracy and a 3.0× inference speedup. By repurposing "dead" weights (those usually rounded to zero) as dynamic biases during training, it overcomes the "deadzone trapping" problem that typically plagues ultra-low-bit models.

What Problem Does This Paper Address?

Deploying LLMs on resource-constrained edge devices (like phones or laptops) requires massive compression. Ternary quantization is a holy grail for this: it restricts weights to just $\{-1, 0, 1\}$. This doesn't just save memory; it replaces expensive floating-point multiplications with simple additions, which hardware can process much faster.

However, there is a catch: Deadzone Trapping. In standard ternary quantization, any weight falling within a certain threshold (the "deadzone") is snapped to zero. During Quantization-Aware Training (QAT), these weights rely on the Straight-Through Estimator (STE) to receive updates. Because the STE provides noisy, low-quality gradients to these zeroed weights, they often get "trapped" at the boundary, unable to contribute to the model's capacity. This leads to a massive "accuracy gap" between the compressed model and its full-precision counterpart.

Comparison of standard ternary quantization suffering from deadzone trapping versus Tequila's trapping-free adaptive bias reactivation.

Methods

The authors introduce Tequila, a "trapping-free" optimization strategy. The core innovation is to stop treating dead weights as useless zeros and instead reactivate them as dynamic biases.

Tequila reactivates dead weights as dynamic biases, allowing for offline computation and zero-overhead inference.
  1. Differentiable Reactivation: Instead of snapping weights in the deadzone to zero, Tequila maps them to a smooth, differentiable function ($\lambda w_i$). This allows gradients to flow directly to these weights without the noise introduced by the STE.
  2. Repurposing as Biases: To keep inference fast, the authors show that these reactivated weights can be treated as an input-agnostic bias term. Essentially, the forward pass becomes: $$Y = XQ(W) + \text{Bias}(W)$$
  3. Hybrid Roles: Weights play a dual role—they participate in the standard ternary matrix multiplication while simultaneously acting as a residual bias.
  4. Zero-Overhead Inference: Because the bias term is input-agnostic, it can be precomputed offline and fused into the model's existing bias layers. At runtime, the model retains the pure, hardware-friendly addition-only logic of ternary math.

Datasets

The researchers evaluated Tequila using:

  • Training: 10B tokens sampled from the UltraFineWeb dataset.
  • Evaluation: Five standard zero-shot benchmarks: PIQA (physical commonsense), ARC-Easy/Challenge (science questions), HellaSwag (contextual reasoning), GPQA-Diamond (graduate-level knowledge), and WinoGrande (adversarial pronoun resolution).
  • Models: The method was tested on LLaMA-3.2 (1B and 3B) and Qwen3-4B.

Key Insights and Ideas

  • The "Aha!" Moment on Gradients: The authors used Gradient Signal-to-Noise Ratio (GSNR) to prove that dead weights in traditional ternary models are essentially "starved" of useful information. Tequila significantly boosts the GSNR for these weights, allowing them to learn effectively.
  • Bias as a Safety Valve: By letting weights contribute as a bias, the model "unlocks" parameters that were previously pruned away. This effectively expands the model's representational capacity without increasing the computational cost during inference.
  • Stability over Complexity: The paper finds that static quantization methods (like AbsMean) often outperform "learnable" quantization parameters because they are less prone to getting stuck in local optima—a finding that reinforces the current trend in open-source ternary LLMs.

Key Results

  • Closing the Accuracy Gap: On the ARC benchmark, Tequila achieved a >4% accuracy gain over state-of-the-art ternary baselines. In many cases, it performed within 1% of the full-precision (BF16) model.
  • Superior Efficiency: The model delivers a 3.0× inference speedup on an Intel CPU compared to the BF16 baseline, matching the speed of "pure" ternary methods like BitNet but with much higher accuracy.
  • Data Efficiency: Tequila reached higher accuracy with only 10B training tokens than some competing methods reached with 100B or even 4T tokens.
  • Generalizability: While designed for ternary (1.58-bit) models, the authors demonstrated that the "repurposed bias" trick also improves 2-bit and 4-bit quantization schemes.

Limitations and Future Work

  • Hyperparameter Sensitivity: The reactivation parameter ($\lambda$) is critical. The authors found that larger models generally prefer a smaller $\lambda$, suggesting that the "optimal" amount of bias reactivation scales with model depth or width.
  • Hardware Specialization: While the math is addition-only, achieving the theoretical 3x speedup requires specific kernel implementations (like lookup tables) to handle the packed ternary weights efficiently.
  • Future Directions: The authors suggest this "weight-to-bias" repurposing could be a foundational technique for "extreme quantization"—pushing models even lower than 1.58 bits without losing the "intelligence" of the original LLM.

Summary updated

BibTeX
@inproceedings{huang2026tequila,
  author = {Hong Huang and Decheng Wu and Rui Cen and Guanghua Yu and Zonghang Li and Kai Liu and Jianchen Zhu and Peng Chen and Xue Liu and Dapeng Wu},
  title = {{Tequila: Trapping-free Ternary Quantization for Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=9CZzD5LWdy},
}
Figure