让小模型也能当智能代理,本地运行更省更安全。
EffGen: Enabling Small Language Models as Capable Autonomous Agents
- 用提示词压缩技术减少70%-80%输入量,保持任务语义不变。
- 复杂任务自动拆解并智能路由,执行速度更快、内存更低。
- 支持多协议通信,适合追求隐私与低成本的开发者使用。
现有语言模型智能体系统多针对大模型设计,依赖API调用,存在高成本和隐私风险。本文提出EffGen,一个专为小语言模型(SLMs)优化的开源智能体框架,支持高效、安全的本地部署。该框架包含四项核心创新:(1) 提示词优化技术可压缩输入达70%-80%(平均57%),同时保留任务语义;(2) 智能任务分解,根据依赖关系并行或串行处理子任务;(3) 基于五类因素的复杂度路由机制,实现预执行智能决策;(4) 统一记忆系统,融合短期、长期及向量存储。此外,EffGen整合了MCP、A2A、ACP等多种代理协议,支持跨协议通信。在13个基准测试中,EffGen在成功率、执行速度和内存占用上均优于LangChain、AutoGen和Smolagents。结果显示,提示词优化对小模型增益更大(1.5B模型提升11.2%,32B仅2.4%),而复杂度路由对大模型更有效(1.5B提升3.6%,32B达7.9%),两者结合可在所有规模上持续提升性能。EffGen采用Apache 2.0许可,代码开源,可通过GitHub、PyPI及官网获取。
原文摘要 · Abstract (English)
Most existing language model agentic systems today are built and optimized for large language models (e.g., GPT, Claude, Gemini) via API calls; while powerful, this approach faces several limitations including high token costs and privacy concerns for sensitive applications. We introduce EffGen, an open-source agentic framework optimized for small language models (SLMs) that enables effective, efficient, and secure local deployment. EffGen makes four major contributions: (1) Enhanced tool-calling with prompt optimization that compresses input prompts by up to 70-80% (and 57% on average across our benchmarks) while preserving task semantics, (2) Intelligent task decomposition that breaks complex queries into parallel or sequential subtasks based on dependencies, (3) Complexity-based routing using five factors to make smart pre-execution decisions, and (4) Unified memory system combining short-term, long-term, and vector-based storage. Additionally, EffGen unifies multiple agent protocols (MCP, A2A, ACP) for cross-protocol communication. Results on 13 benchmarks show EffGen outperforms LangChain, AutoGen, and Smolagents with higher success rates, faster execution, and lower memory. Our results reveal that prompt optimization and complexity routing have complementary scaling behavior: optimization benefits SLMs more (11.2% gain at 1.5B vs 2.4% at 32B), while routing benefits large models more (3.6% at 1.5B vs 7.9% at 32B), providing consistent gains across all scales when combined. EffGen is released under the Apache 2.0 License, ensuring broad accessibility for research and commercial use, with the code available at https://github.com/ctrl-gaurav/effGen, the Python package at https://pypi.org/project/effgen/ (pip install effgen), and the project website and documentation at https://effgen.org/ and https://docs.effgen.org/.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。