[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-hao-ai-lab--LookaheadDecoding":3,"tool-hao-ai-lab--LookaheadDecoding":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":10,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":106,"github_topics":79,"view_count":107,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":108,"updated_at":109,"faqs":110,"releases":141},120,"hao-ai-lab\u002FLookaheadDecoding","LookaheadDecoding","[ICML 2024] Break the Sequential Dependency of LLM Inference Using Lookahead Decoding","LookaheadDecoding 是一种用于加速大语言模型（LLM）推理的开源并行解码算法，无需依赖草稿模型或外部数据存储。它解决了传统自回归生成中逐字串行解码导致的延迟问题——每次只能生成一个词，效率受限。通过借鉴 Jacobi 迭代思想，LookaheadDecoding 在每一步并行预测多个未来词（n-gram），并利用双分支机制：一边“前瞻”生成候选词序列，一边快速验证这些序列的有效性。其核心创新在于将整个过程整合到单一注意力掩码中，充分利用 GPU 并行能力，在保持生成质量的同时显著减少实际推理步数。该方法已在 LLaMA-2 等模型上验证有效，适合 AI 研究人员和开发者集成到自己的推理系统中，尤其适用于对生成速度有较高要求的文本生成场景。普通用户虽不直接使用，但可间接受益于更快的 AI 应用响应。","\u003Cdiv align=\"center\">\u003Ch1>&nbsp;Break the Sequential Dependency of LLM Inference Using Lookahead Decoding\u003C\u002Fh1>\u003C\u002Fdiv>\r\n\r\n\u003Cp align=\"center\">\r\n| \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.02057\">\u003Cb>Paper\u003C\u002Fb>\u003C\u002Fa> | \u003Ca href=\"https:\u002F\u002Flmsys.org\u002Fblog\u002F2023-11-21-lookahead-decoding\u002F\">\u003Cb>Blog\u003C\u002Fb>\u003C\u002Fa> | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F13\">\u003Cb>Roadmap\u003C\u002Fb>\u003C\u002Fa> | \r\n\u003C\u002Fp>\r\n\r\n---\r\n*News* 🔥\r\n- [2024\u002F2] Lookahead Decoding Paper now available on [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.02057). [Sampling](#use-lookahead-decoding-in-your-own-code) and [FlashAttention](#flashAttention-support) are supported. Advanced features for better token prediction are updated.\r\n\r\n---\r\n## Introduction \r\nWe introduce lookahead decoding:\r\n- A parallel decoding algorithm to accelerate LLM inference.\r\n- Without the need for a draft model or a data store.\r\n- Linearly decreases #decoding steps relative to log(FLOPs) used per decoding step.\r\n\r\nBelow is a demo of lookahead decoding accelerating LLaMa-2-Chat 7B generation:\r\n\r\n\u003Cdiv align=\"center\">\r\n  \u003Cpicture>\r\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_b464445af8b9.gif\" width=\"80%\">\r\n  \u003C\u002Fpicture>\r\n  \u003Cbr>\r\n  \u003Cdiv align=\"center\" width=\"80%\">\r\n  \u003Cem>Demo of speedups by lookahead decoding on LLaMA-2-Chat 7B generation. Blue fonts are tokens generated in parallel in a decoding step.\u003C\u002Fem>\r\n  \u003C\u002Fdiv>\r\n  \u003Cbr>\r\n\u003C\u002Fdiv>\r\n\r\n### Background: Parallel LLM Decoding Using Jacobi Iteration\r\n\r\nLookahead decoding is motivated by [Jacobi decoding](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2305.10427.pdf), which views autoregressive decoding as solving nonlinear systems and decodes all future tokens simultaneously using a fixed-point iteration method. Below is a Jacobi decoding example.\r\n\r\n\u003Cdiv align=\"center\">\r\n  \u003Cpicture>\r\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_4ad39476532d.gif\" width=\"80%\">\r\n  \u003C\u002Fpicture>\r\n  \u003Cbr>\r\n  \u003Cdiv align=\"center\" width=\"80%\">\r\n  \u003Cem>Illustration of applying Jacobi iteration method for parallel LLM decoding.\u003C\u002Fem>\r\n  \u003C\u002Fdiv>\r\n  \u003Cbr>\r\n\u003C\u002Fdiv>\r\n\r\nHowever, Jacobi decoding can barely see wall-clock speedup in real-world LLM applications.\r\n\r\n### Lookahead Decoding: Make Jacobi Decoding Feasible\r\n\r\nLookahead decoding takes advantage of Jacobi decoding's ability by collecting and caching n-grams generated from Jacobi iteration trajectories.\r\n\r\nThe following gif shows the process of collecting 2 grams via Jacobi decoding and verifying them to accelerate decoding.\r\n\r\n\u003Cdiv align=\"center\">\r\n  \u003Cpicture>\r\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_f27667657cd0.gif\" width=\"80%\">\r\n  \u003C\u002Fpicture>\r\n  \u003Cbr>\r\n  \u003Cdiv align=\"center\" width=\"80%\">\r\n  \u003Cem>Illustration of lookahead decoding with 2-grams.\u003C\u002Fem>\r\n  \u003C\u002Fdiv>\r\n  \u003Cbr>\r\n\u003C\u002Fdiv>\r\n\r\nTo enhance the efficiency of this process, each lookahead decoding step is divided into two parallel branches: the lookahead branch and the verification branch. The lookahead branch maintains a fixed-sized, 2D window to generate n-grams from the Jacobi iteration trajectory. Simultaneously, the verification branch selects and verifies promising n-gram candidates.\r\n\r\n### Lookahead Branch and Verification Branch\r\n\r\nThe lookahead branch aims to generate new N-grams. The branch operates with a two-dimensional window defined by two parameters:\r\n- Window size W: How far ahead we look in future token positions to conduct parallel decoding.\r\n- N-gram size N: How many steps we look back into the past Jacobi iteration trajectory to retrieve n-grams.\r\n\r\nIn the verification branch, we identify n-grams whose first token matches the last input token. This is determined via simple string match. Once identified, these n-grams are appended to the current input and subjected to verification via an LLM forward pass through them.\r\n\r\nWe implement these branches in one attention mask to further utilize GPU's parallel computing power.\r\n\r\n\u003Cdiv align=\"center\">\r\n  \u003Cpicture>\r\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_a4dfff45fdce.png\" width=\"40%\">\r\n  \u003C\u002Fpicture>\r\n  \u003Cbr>\r\n  \u003Cdiv align=\"center\" width=\"80%\">\r\n  \u003Cem>Attention mask for lookahead decoding with 4-grams and window size 5. In this mask, two 4-gram candidates (bottom right) are verified concurrently with parallel decoding.\u003C\u002Fem>\r\n  \u003C\u002Fdiv>\r\n  \u003Cbr>\r\n\u003C\u002Fdiv>\r\n\r\n### Experimental Results\r\n\r\nOur study shows lookahead decoding substantially reduces latency, ranging from 1.5x to 2.3x on different datasets on a single GPU. See the figure below.\r\n\r\n\u003Cdiv align=\"center\">\r\n  \u003Cpicture>\r\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_4b2ea6f93962.png\" width=\"80%\">\r\n  \u003C\u002Fpicture>\r\n  \u003Cbr>\r\n  \u003Cdiv align=\"center\" width=\"80%\">\r\n  \u003Cem>Speedup of lookahead decoding on different models and datasets.\u003C\u002Fem>\r\n  \u003C\u002Fdiv>\r\n  \u003Cbr>\r\n\u003C\u002Fdiv>\r\n\r\n## Contents\r\n- [Introduction](#introduction)\r\n- [Contents](#contents)\r\n- [Installation](#installation)\r\n  - [Install With Pip](#install-with-pip)\r\n  - [Install From The Source](#install-from-the-source)\r\n  - [Inference](#inference-with-lookahead-decoding)\r\n  - [Use In Your Own Code](#use-lookahead-decoding-in-your-own-code)\r\n- [Citation](#citation)\r\n- [Guidance](#guidance)\r\n\r\n\r\n## Installation\r\n### Install with pip\r\n```bash\r\npip install lade\r\n```\r\n### Install from the source\r\n```bash\r\ngit clone https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding.git\r\ncd LookaheadDecoding\r\npip install -r requirements.txt\r\npip install -e .\r\n```\r\n\r\n### Inference With Lookahead decoding\r\nYou can run the minimal example to see the speedup that Lookahead decoding brings.\r\n```bash\r\npython minimal.py #no Lookahead decoding\r\nUSE_LADE=1 LOAD_LADE=1 python minimal.py #use Lookahead decoding, 1.6x speedup\r\n```\r\n\r\nYou can also enjoy chatting with your own chatbots with Lookahead decoding.\r\n```bash\r\nUSE_LADE=1 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug --chat #chat, with lookahead \r\nUSE_LADE=0 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug --chat #chat, without lookahead\r\n\r\n\r\nUSE_LADE=1 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug #no chat, with lookahead\r\nUSE_LADE=0 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug #no chat, without lookahead\r\n```\r\n\r\n### Use Lookahead decoding in your own code\r\nYou can import and use Lookahead decoding in your own code in three LoCs. You also need to set ```USE_LADE=1``` in command line or set ```os.environ[\"USE_LADE\"]=\"1\"``` in Python script. Note that Lookahead decoding only support LLaMA yet.\r\n\r\n```python\r\nimport lade\r\nlade.augment_all()\r\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, DEBUG=0) \r\n#LEVEL, WINDOW_SIZE and GUESS_SET_SIZE are three important configurations (N,W,G) in lookahead decoding, please refer to our blog!\r\n#You can obtain a better performance by tuning LEVEL\u002FWINDOW_SIZE\u002FGUESS_SET_SIZE on your own device.\r\n```\r\n\r\nThen you can speedup the decoding process. Here is an example using greedy search:\r\n```\r\ntokenizer = AutoTokenizer.from_pretrained(model_name)\r\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device)\r\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\r\ngreedy_output = model.generate(**model_inputs, max_new_tokens=1024) #speedup obtained\r\n```\r\n\r\nHere is an example using sampling:\r\n```\r\ntokenizer = AutoTokenizer.from_pretrained(model_name)\r\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device)\r\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\r\nsample_output = model.generate(**model_inputs, max_new_tokens=1024, temperature=0.7) #speedup obtained\r\n```\r\n\r\n### FlashAttention Support\r\nInstall the original FlashAttention\r\n```bash\r\npip install flash-attn==2.3.3 #original FlashAttention\r\n```\r\nTwo ways to install FlashAttention specialized for Lookahead Decoding\r\n1) Download a pre-built package on https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead\u002Freleases\u002Ftag\u002Fv2.3.3 and install (fast, recommended).\r\nFor example, I have cuda==11.8, python==3.9 and torch==2.1, I should do the following: \r\n```bash\r\nwget https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead\u002Freleases\u002Fdownload\u002Fv2.3.3\u002Fflash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\r\npip install flash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\r\n```\r\n2) Install from the source (slow, not recommended)\r\n```bash\r\ngit clone https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead.git\r\ncd flash-attention-lookahead && python setup.py install\r\n```\r\n\r\nHere is an example script to run the models with FlashAttention: \r\n```bash\r\npython minimal-flash.py #no Lookahead decoding, w\u002F FlashAttention\r\nUSE_LADE=1 LOAD_LADE=1 python minimal-flash.py #use Lookahead decoding, w\u002F FlashAttention, 20% speedup than w\u002Fo FlashAttention\r\n```\r\n\r\nIn your own code, you need to set ```USE_FLASH=True``` when calling ```config_lade```, and set ```attn_implementation=\"flash_attention_2\"``` when calling ```AutoModelForCausalLM.from_pretrained```.\r\n```python\r\nimport lade\r\nlade.augment_all()\r\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, USE_FLASH=True, DEBUG=0) \r\ntokenizer = AutoTokenizer.from_pretrained(model_name)\r\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device, attn_implementation=\"flash_attention_2\")\r\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\r\ngreedy_output = model.generate(**model_inputs, max_new_tokens=1024) #speedup obtained\r\n```\r\nWe will integrate FlashAttention directly into this repo for simple installation and usage.\r\n\r\n## Citation\r\n```bibtex\r\n@article{fu2024break,\r\n  title={Break the sequential dependency of llm inference using lookahead decoding},\r\n  author={Fu, Yichao and Bailis, Peter and Stoica, Ion and Zhang, Hao},\r\n  journal={arXiv preprint arXiv:2402.02057},\r\n  year={2024}\r\n}\r\n```\r\n## Guidance\r\nThe core implementation is in decoding.py. Lookahead decoding requires an adaptation for each specific model. An example is in models\u002Fllama.py.\r\n\r\n","\u003Cdiv align=\"center\">\u003Ch1>&nbsp;使用前瞻解码（Lookahead Decoding）打破大语言模型（LLM）推理的顺序依赖\u003C\u002Fh1>\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n| \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.02057\">\u003Cb>论文\u003C\u002Fb>\u003C\u002Fa> | \u003Ca href=\"https:\u002F\u002Flmsys.org\u002Fblog\u002F2023-11-21-lookahead-decoding\u002F\">\u003Cb>博客\u003C\u002Fb>\u003C\u002Fa> | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F13\">\u003Cb>路线图\u003C\u002Fb>\u003C\u002Fa> | \n\u003C\u002Fp>\n\n---\n*新闻* 🔥\n- [2024\u002F2] 前瞻解码（Lookahead Decoding）论文现已发布于 [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.02057)。现已支持 [采样（Sampling）](#use-lookahead-decoding-in-your-own-code) 和 [FlashAttention](#flashAttention-support)。用于提升 token 预测效果的高级功能已更新。\n\n---\n## 简介 \n我们提出了前瞻解码（lookahead decoding）：\n- 一种用于加速大语言模型（Large Language Model, LLM）推理的并行解码算法。\n- 无需草稿模型（draft model）或数据存储（data store）。\n- 在每个解码步骤所用计算量（FLOPs）对数增长的情况下，线性减少解码步数。\n\n下图展示了前瞻解码加速 LLaMa-2-Chat 7B 生成的演示：\n\n\u003Cdiv align=\"center\">\n  \u003Cpicture>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_b464445af8b9.gif\" width=\"80%\">\n  \u003C\u002Fpicture>\n  \u003Cbr>\n  \u003Cdiv align=\"center\" width=\"80%\">\n  \u003Cem>前瞻解码在 LLaMA-2-Chat 7B 生成任务中的加速演示。蓝色字体表示在一个解码步骤中并行生成的 token。\u003C\u002Fem>\n  \u003C\u002Fdiv>\n  \u003Cbr>\n\u003C\u002Fdiv>\n\n### 背景：使用 Jacobi 迭代进行并行 LLM 解码\n\n前瞻解码受 [Jacobi 解码](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2305.10427.pdf) 启发，该方法将自回归解码视为求解非线性方程组，并使用不动点迭代法同时解码所有未来 token。下图展示了一个 Jacobi 解码示例。\n\n\u003Cdiv align=\"center\">\n  \u003Cpicture>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_4ad39476532d.gif\" width=\"80%\">\n  \u003C\u002Fpicture>\n  \u003Cbr>\n  \u003Cdiv align=\"center\" width=\"80%\">\n  \u003Cem>应用 Jacobi 迭代法进行并行 LLM 解码的示意图。\u003C\u002Fem>\n  \u003C\u002Fdiv>\n  \u003Cbr>\n\u003C\u002Fdiv>\n\n然而，Jacobi 解码在实际 LLM 应用中几乎无法带来实际运行时间（wall-clock time）上的加速。\n\n### 前瞻解码：让 Jacobi 解码变得可行\n\n前瞻解码利用 Jacobi 解码的能力，通过收集并缓存从 Jacobi 迭代轨迹中生成的 n-gram（连续 n 个 token 的序列）来实现加速。\n\n下图展示了通过 Jacobi 解码收集 2-gram 并验证它们以加速解码的过程。\n\n\u003Cdiv align=\"center\">\n  \u003Cpicture>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_f27667657cd0.gif\" width=\"80%\">\n  \u003C\u002Fpicture>\n  \u003Cbr>\n  \u003Cdiv align=\"center\" width=\"80%\">\n  \u003Cem>使用 2-gram 的前瞻解码示意图。\u003C\u002Fem>\n  \u003C\u002Fdiv>\n  \u003Cbr>\n\u003C\u002Fdiv>\n\n为了提升该过程的效率，每个前瞻解码步骤被划分为两个并行分支：前瞻分支（lookahead branch）和验证分支（verification branch）。前瞻分支维护一个固定大小的二维窗口，从 Jacobi 迭代轨迹中生成 n-gram；同时，验证分支选择并验证有希望的 n-gram 候选。\n\n### 前瞻分支与验证分支\n\n前瞻分支的目标是生成新的 N-gram。该分支通过两个参数定义的二维窗口进行操作：\n- 窗口大小 W（Window size W）：我们在未来 token 位置上向前看多远以进行并行解码。\n- N-gram 大小 N（N-gram size N）：我们回溯 Jacobi 迭代轨迹多少步以检索 n-gram。\n\n在验证分支中，我们识别出首 token 与当前输入最后一个 token 匹配的 n-gram。这通过简单的字符串匹配确定。一旦识别成功，这些 n-gram 就会被附加到当前输入，并通过一次 LLM 前向传播（forward pass）进行验证。\n\n我们将这两个分支实现在一个注意力掩码（attention mask）中，以进一步利用 GPU 的并行计算能力。\n\n\u003Cdiv align=\"center\">\n  \u003Cpicture>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_a4dfff45fdce.png\" width=\"40%\">\n  \u003C\u002Fpicture>\n  \u003Cbr>\n  \u003Cdiv align=\"center\" width=\"80%\">\n  \u003Cem>使用 4-gram 和窗口大小为 5 的前瞻解码注意力掩码。在此掩码中，两个 4-gram 候选（右下角）与并行解码同时进行验证。\u003C\u002Fem>\n  \u003C\u002Fdiv>\n  \u003Cbr>\n\u003C\u002Fdiv>\n\n### 实验结果\n\n我们的研究表明，前瞻解码在单 GPU 上显著降低了延迟，在不同数据集上实现了 1.5 倍至 2.3 倍的加速。见下图。\n\n\u003Cdiv align=\"center\">\n  \u003Cpicture>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_readme_4b2ea6f93962.png\" width=\"80%\">\n  \u003C\u002Fpicture>\n  \u003Cbr>\n  \u003Cdiv align=\"center\" width=\"80%\">\n  \u003Cem>前瞻解码在不同模型和数据集上的加速效果。\u003C\u002Fem>\n  \u003C\u002Fdiv>\n  \u003Cbr>\n\u003C\u002Fdiv>\n\n## 目录\n- [简介](#introduction)\n- [目录](#contents)\n- [安装](#installation)\n  - [使用 Pip 安装](#install-with-pip)\n  - [从源码安装](#install-from-the-source)\n  - [使用前瞻解码进行推理](#inference-with-lookahead-decoding)\n  - [在您自己的代码中使用](#use-lookahead-decoding-in-your-own-code)\n- [引用](#citation)\n- [指导](#guidance)\n\n\n## 安装\n### 使用 pip 安装\n```bash\npip install lade\n```\n### 从源码安装\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding.git\ncd LookaheadDecoding\npip install -r requirements.txt\npip install -e .\n```\n\n### 使用前瞻解码进行推理\n您可以运行最小示例，观察前瞻解码带来的加速效果。\n```bash\npython minimal.py # 不使用前瞻解码\nUSE_LADE=1 LOAD_LADE=1 python minimal.py # 使用前瞻解码，获得 1.6 倍加速\n```\n\n您也可以使用前瞻解码与自己的聊天机器人进行对话。\n```bash\nUSE_LADE=1 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug --chat # 使用前瞻解码进行聊天\nUSE_LADE=0 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug --chat # 不使用前瞻解码进行聊天\n\n\nUSE_LADE=1 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug # 不聊天，但使用前瞻解码\nUSE_LADE=0 python applications\u002Fchatbot.py  --model_path meta-llama\u002FLlama-2-7b-chat-hf --debug # 不聊天，也不使用前瞻解码\n```\n\n### 在您自己的代码中使用 Lookahead decoding（前瞻解码）\n您只需三行代码即可在自己的项目中导入并使用 Lookahead decoding。同时，您需要在命令行中设置 ```USE_LADE=1```，或在 Python 脚本中设置 ```os.environ[\"USE_LADE\"]=\"1\"```。请注意，目前 Lookahead decoding 仅支持 LLaMA 模型。\n\n```python\nimport lade\nlade.augment_all()\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, DEBUG=0) \n# LEVEL、WINDOW_SIZE 和 GUESS_SET_SIZE 是 Lookahead decoding 中三个重要的配置参数（N, W, G），请参考我们的博客！\n# 您可以通过在自己的设备上调整 LEVEL\u002FWINDOW_SIZE\u002FGUESS_SET_SIZE 来获得更好的性能。\n```\n\n随后即可加速解码过程。以下是一个使用贪心搜索（greedy search）的示例：\n```python\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device)\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\ngreedy_output = model.generate(**model_inputs, max_new_tokens=1024) # 获得加速效果\n```\n\n以下是一个使用采样（sampling）的示例：\n```python\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device)\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\nsample_output = model.generate(**model_inputs, max_new_tokens=1024, temperature=0.7) # 获得加速效果\n```\n\n### FlashAttention 支持\n安装原始的 FlashAttention：\n```bash\npip install flash-attn==2.3.3 # 原始 FlashAttention\n```\n\n有两种方式安装专为 Lookahead Decoding 优化的 FlashAttention：\n\n1) 从 https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead\u002Freleases\u002Ftag\u002Fv2.3.3 下载预编译包并安装（快速，推荐）。  \n例如，我的环境是 cuda==11.8、python==3.9、torch==2.1，则应执行以下命令：\n```bash\nwget https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead\u002Freleases\u002Fdownload\u002Fv2.3.3\u002Fflash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\npip install flash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\n```\n\n2) 从源码安装（较慢，不推荐）：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead.git\ncd flash-attention-lookahead && python setup.py install\n```\n\n以下是使用 FlashAttention 运行模型的示例脚本：\n```bash\npython minimal-flash.py # 不使用 Lookahead decoding，启用 FlashAttention\nUSE_LADE=1 LOAD_LADE=1 python minimal-flash.py # 使用 Lookahead decoding，启用 FlashAttention，相比不使用 FlashAttention 提升约 20% 速度\n```\n\n在您自己的代码中，调用 ```config_lade``` 时需设置 ```USE_FLASH=True```，并在调用 ```AutoModelForCausalLM.from_pretrained``` 时设置 ```attn_implementation=\"flash_attention_2\"```：\n```python\nimport lade\nlade.augment_all()\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, USE_FLASH=True, DEBUG=0) \ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, device_map=torch_device, attn_implementation=\"flash_attention_2\")\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\ngreedy_output = model.generate(**model_inputs, max_new_tokens=1024) # 获得加速效果\n```\n我们将把 FlashAttention 直接集成到本仓库中，以简化安装和使用流程。\n\n## 引用\n```bibtex\n@article{fu2024break,\n  title={Break the sequential dependency of llm inference using lookahead decoding},\n  author={Fu, Yichao and Bailis, Peter and Stoica, Ion and Zhang, Hao},\n  journal={arXiv preprint arXiv:2402.02057},\n  year={2024}\n}\n```\n## 使用指南\n核心实现在 decoding.py 中。Lookahead decoding 需要针对每个具体模型进行适配，示例见 models\u002Fllama.py。","# LookaheadDecoding 快速上手指南\n\nLookaheadDecoding 是一种用于加速大语言模型（LLM）推理的并行解码算法，无需草稿模型或外部数据存储，已在 LLaMA 系列模型上验证有效。\n\n---\n\n## 环境准备\n\n- **操作系统**：Linux（推荐 Ubuntu 20.04+）\n- **Python 版本**：≥ 3.8\n- **PyTorch 版本**：≥ 2.0（建议 2.1+）\n- **CUDA**：≥ 11.7（若使用 GPU 加速）\n- **模型支持**：目前仅支持 **LLaMA \u002F LLaMA-2** 架构（包括 `meta-llama\u002FLlama-2-7b-chat-hf` 等 Hugging Face 模型）\n\n> 💡 建议使用国内镜像源加速依赖安装，例如：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n---\n\n## 安装步骤\n\n### 方法一：通过 pip 安装（推荐）\n```bash\npip install lade\n```\n\n### 方法二：从源码安装\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding.git\ncd LookaheadDecoding\npip install -r requirements.txt\npip install -e .\n```\n\n### （可选）启用 FlashAttention 支持（进一步提速）\n\n1. 安装通用 FlashAttention：\n   ```bash\n   pip install flash-attn==2.3.3\n   ```\n\n2. **推荐**：安装专为 LookaheadDecoding 优化的预编译版本（根据你的 CUDA、PyTorch 和 Python 版本选择）  \n   示例（CUDA 11.8 + PyTorch 2.1 + Python 3.9）：\n   ```bash\n   wget https:\u002F\u002Fgithub.com\u002FViol2000\u002Fflash-attention-lookahead\u002Freleases\u002Fdownload\u002Fv2.3.3\u002Fflash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\n   pip install flash_attn_lade-2.3.3+cu118torch2.1cxx11abiFALSE-cp39-cp39-linux_x86_64.whl\n   ```\n\n---\n\n## 基本使用\n\n### 1. 最简示例（命令行）\n```bash\n# 不使用 LookaheadDecoding\npython minimal.py\n\n# 启用 LookaheadDecoding（约 1.6 倍加速）\nUSE_LADE=1 LOAD_LADE=1 python minimal.py\n```\n\n### 2. 在自己的代码中启用（仅需 3 行）\n\n```python\nimport os\nos.environ[\"USE_LADE\"] = \"1\"  # 或在命令行设置 USE_LADE=1\n\nimport lade\nlade.augment_all()\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, DEBUG=0)\n\n# 正常加载模型和生成文本\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\nimport torch\n\nmodel_name = \"meta-llama\u002FLlama-2-7b-chat-hf\"\ntorch_device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name, torch_dtype=torch.float16, device_map=torch_device\n)\n\ninput_text = \"Hello, how are you?\"\nmodel_inputs = tokenizer(input_text, return_tensors='pt').to(torch_device)\n\n# 自动生成时自动加速（支持 greedy 和 sampling）\noutput = model.generate(**model_inputs, max_new_tokens=128, temperature=0.7)\nprint(tokenizer.decode(output[0], skip_special_tokens=True))\n```\n\n### 3. 启用 FlashAttention（如已安装）\n\n在 `config_lade` 中设置 `USE_FLASH=True`，并在加载模型时指定 `attn_implementation=\"flash_attention_2\"`：\n\n```python\nlade.config_lade(LEVEL=5, WINDOW_SIZE=7, GUESS_SET_SIZE=7, USE_FLASH=True, DEBUG=0)\n\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name,\n    torch_dtype=torch.float16,\n    device_map=torch_device,\n    attn_implementation=\"flash_attention_2\"\n)\n```\n\n> 🔧 **提示**：`LEVEL`、`WINDOW_SIZE`、`GUESS_SET_SIZE` 对应论文中的 N、W、G 参数，可根据硬件和任务微调以获得最佳性能。","某AI创业公司正在部署LLaMA-2-7B模型，为客服系统提供实时对话生成能力，要求在用户输入后1秒内返回完整回复。\n\n### 没有 LookaheadDecoding 时\n- LLM必须逐个生成token，即使GPU算力充足也无法并行，导致平均响应时间达1.8秒，超出用户体验阈值。\n- 高并发场景下，大量请求排队等待解码完成，服务器资源利用率不均，GPU计算单元频繁空闲。\n- 为缩短延迟，团队尝试使用推测解码（speculative decoding），但需额外维护一个小型草稿模型，增加了部署复杂度和内存开销。\n- 对于常见问答模式（如“订单状态？”→“请提供订单号”），模型仍重复执行相同推理路径，无法复用历史预测结果。\n- 开发者难以在不牺牲生成质量的前提下进一步优化推理速度。\n\n### 使用 LookaheadDecoding 后\n- 利用Jacobi迭代轨迹预生成n-gram候选，在单次前向传播中并行验证多个token，平均响应时间降至0.9秒，满足实时性要求。\n- GPU计算负载更密集，吞吐量提升近2倍，相同硬件可支撑更多并发用户。\n- 无需额外草稿模型或外部缓存，仅通过修改注意力掩码即可集成到现有推理流程，部署成本极低。\n- 常见对话片段（如固定话术）被高效捕获并批量验证，显著减少冗余计算。\n- 在保持原始模型输出质量的同时，实现了接近线性的解码步数压缩。\n\nLookaheadDecoding通过打破大模型推理的串行依赖，在不增加系统复杂度的前提下，让实时对话生成真正达到生产级响应速度。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhao-ai-lab_LookaheadDecoding_a4dfff45.png","hao-ai-lab","Hao AI Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fhao-ai-lab_45215a02.png","",null,"haoailab","https:\u002F\u002Fhao-ai-lab.github.io","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab",[84,88],{"name":85,"color":86,"percentage":87},"Python","#3572A5",99.4,{"name":89,"color":90,"percentage":91},"Shell","#89e051",0.6,1326,82,"2026-04-05T02:21:07","Apache-2.0","Linux","需要 NVIDIA GPU，显存 8GB+（用于运行 LLaMA-2-7B 等模型），CUDA 版本需与 FlashAttention 兼容（如 CUDA 11.8）","未说明",{"notes":100,"python":98,"dependencies":101},"目前仅支持 LLaMA 系列模型；若使用 FlashAttention 需安装特定版本或从源码编译；通过环境变量 USE_LADE=1 启用 Lookahead Decoding；配置参数 LEVEL、WINDOW_SIZE 和 GUESS_SET_SIZE 可影响性能，建议根据设备调优。",[102,103,104,105],"torch","transformers","accelerate","flash-attn==2.3.3",[26,13],6,"2026-03-27T02:49:30.150509","2026-04-06T05:16:58.353916",[111,116,121,126,131,136],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},106,"除了减少解码步骤外，Jacobi 解码还有哪些优势？能否用普通贪心解码替代？","Jacobi 解码在推理时通过并行预测多个未来 token 来提升效率。从注意力计算维度看，使用 KV 缓存时，普通贪心解码每步计算形状为 $1 \\times (\\ell+1)$，而 Jacobi 或推测解码会扩展为 $(\\alpha+1) \\times (\\ell+\\alpha+1)$，虽然单步计算量增加，但减少了总步数。直接替换为贪心解码会丧失这种并行加速能力，降低整体效率。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F33",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},107,"Jacobi 解码是如何工作的？它是否依赖随机猜测未来 token？","Jacobi 解码确实从初始猜测开始（如使用 [PAD] token 而非随机词汇），并通过多次迭代逐步修正这些猜测。每次迭代中，模型基于当前序列（包含部分已确认和部分猜测的 token）重新预测，使得猜测逐渐收敛。值得注意的是，原始 Jacobi 解码论文使用 [PAD] token 作为占位符，而非随机词表 token，以减少错误传播。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F37",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},108,"在 Lookahead 解码中，当前迭代的 token 是如何参与注意力计算的？是否应关注同轮次的其他 token？","在 Lookahead 解码（如图5所示）中，当前生成的 token（如红色位置6）实际关注的是前一轮已确认的 token（如绿色位置5），而非同轮次的其他猜测 token（如红色位置5）。这是因为同轮次的 token 尚未被验证，彼此之间缺乏语义连贯性；而使用已确认的上下文能形成更有意义的 n-gram，提高后续 token 的预测质量。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F28",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},109,"运行 chatbot.py 时设置 USE_LADE=0 报错，如何解决？","该问题已在项目中修复。请确保使用最新代码版本。若仍遇到问题，可检查是否正确加载了未启用 LADE 的模型路径，并确认 applications\u002Fchatbot.py 中的调用逻辑与当前代码库一致。维护者已在 Issue #65 中标记“已修复”。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F65",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},110,"运行时出现 'NoneType' object is not subscriptable 错误（decoding.py 第427行），如何解决？","此错误通常由 transformers 版本过高引起。项目当前兼容 transformers==4.34.0，而使用 4.36.2 等新版会导致 past_key_values 返回 None。解决方案是降级 transformers 至 4.34.0，或等待项目更新以支持新版。该问题与 Issue #35 和 #38 相关，已在开发中修复。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F40",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},111,"Lookahead 解码是否支持微调后的 Llama2 模型？","项目支持微调后的 Llama2 模型，只要该模型基于标准 Hugging Face Transformers 格式保存（即包含 config.json 和 pytorch_model.bin 等文件）。使用时只需将 --model_path 指向微调模型目录即可，无需额外修改代码。","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FLookaheadDecoding\u002Fissues\u002F12",[]]