speculative decoding
0.2.0
对推测解码的一些最新技术的探索
还有一些我自己的想法,如果可行的话,我将尝试在这个存储库中分享。最初的目标是使用它来加速 Spear-TTS 中的文本到语义解码器
在早期退出方案中,在规范解码期间缓存隐藏层,因为小型和大型模型共享相同的前几层
为了提前退出,允许额外的变压器块头(与主变压器杆分开)
找出批量规格解码 - 不同的行可能以不同的速率前进
进一步优化批量规范解码,因为所有索引都会损失一些性能 - 似乎需要一些工作才能使该技术真正可用
使批量规范解码与提前退出策略一起工作
使用预言变压器的想法完成推测性采样 - 似乎效果很好! ?
获取一些 wandb 图表,看看先知与早期退出策略的比较如何,在存储库上分享
还可以进行实验,看看预言变压器是否会给主模型损失带来任何好处。最初的预言家论文只做了简单的线性投影
对于早期退出策略,尝试将最后缓存的嵌入随机求和回同一模型(a la alphafold2 回收),沿序列长度随机裁剪,并以这种方式训练早期退出损失。看看是否可以通过这种方式提高伽玛值
花一个上午的时间进行微观优化
@inproceedings { Leviathan2022FastIF ,
title = { Fast Inference from Transformers via Speculative Decoding } ,
author = { Yaniv Leviathan and Matan Kalman and Y. Matias } ,
booktitle = { International Conference on Machine Learning } ,
year = { 2022 } ,
url = { https://api.semanticscholar.org/CorpusID:254096365 }
}
@inproceedings { sun2023spectr ,
title = { SpecTr: Fast Speculative Decoding via Optimal Transport } ,
author = { Ziteng Sun and Ananda Theertha Suresh and Jae Hun Ro and Ahmad Beirami and Himanshu Jain and Felix Yu and Michael Riley and Sanjiv Kumar } ,
booktitle = { Workshop on Efficient Systems for Foundation Models @ ICML2023 } ,
year = { 2023 } ,
url = { https://openreview.net/forum?id=d0mGsaheuT }
}
@article { Chen2023AcceleratingLL ,
title = { Accelerating Large Language Model Decoding with Speculative Sampling } ,
author = { Charlie Chen and Sebastian Borgeaud and Geoffrey Irving and Jean-Baptiste Lespiau and L. Sifre and John M. Jumper } ,
journal = { ArXiv } ,
year = { 2023 } ,
volume = { abs/2302.01318 } ,
url = { https://api.semanticscholar.org/CorpusID:256503945 }
}
@article { Yan2020ProphetNetPF ,
title = { ProphetNet: Predicting Future N-gram for Sequence-to-Sequence Pre-training } ,
author = { Yu Yan and Weizhen Qi and Yeyun Gong and Dayiheng Liu and Nan Duan and Jiusheng Chen and Ruofei Zhang and Ming Zhou } ,
journal = { ArXiv } ,
year = { 2020 } ,
volume = { abs/2001.04063 } ,
url = { https://api.semanticscholar.org/CorpusID:210164665 }
}
@article { Zhang2023DraftV ,
title = { Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding } ,
author = { Jinchao Zhang and Jue Wang and Huan Li and Lidan Shou and Ke Chen and Gang Chen and Sharad Mehrotra } ,
journal = { ArXiv } ,
year = { 2023 } ,
volume = { abs/2309.08168 } ,
url = { https://api.semanticscholar.org/CorpusID:262013673 }
}
@misc { medusa ,
author = { Tianle Cai and Yuhong Li and Zhengyang Geng and Hongwu Peng and Tri Dao } ,
title = { Medusa: Simple Framework for Accelerating LLM Generation with Multiple Decoding Heads } ,
year = { 2023 } ,
publisher = { GitHub } ,
journal = { GitHub repository } ,
howpublished = { url{https://github.com/FasterDecoding/Medusa} } ,
}