Transformer tricks: Precomputing the first layer
–arXiv.org Artificial Intelligence
This micro-paper describes a trick to speed up inference of transformers with RoPE (such as LLaMA, Mistral, PaLM, and Gemma). For these models, a large portion of the first transformer layer can be precomputed, which results in slightly lower latency and lower cost-per-token. Because this trick optimizes only one layer, the relative savings depend on the total number of layers. For example, the maximum savings for a model with only 4 layers (such as Whisper tiny) is limited to 25%, while a 32-layer model is limited to 3% savings. See https://github.com/OpenMachine-ai/transformer-tricks for code and more transformer tricks.
arXiv.org Artificial Intelligence
Mar-11-2024
- Country:
- North America > United States > California
- San Francisco County > San Francisco (0.14)
- San Mateo County > South San Francisco (0.04)
- North America > United States > California
- Genre:
- Research Report (0.40)
- Technology: