什么是上下文工程及其在实际系统中的应用

📄 中文摘要

AI代码助手生成了一个处理用户上传的函数,该代码看似正确,能够编译并通过所有测试。然而,在合并后两天内,出现了一个高优先级的bug,导致来自高级计划用户的文件被错误地处理在标准的、较慢的队列中。生成的代码调用了通用函数`enqueue_job()`,因为它并不知道特定用户角色的实用函数`priority_enqueue_job()`的存在。虽然代码在语法上是正确的,但在系统的上下文中却是错误的。这种情况反映了大多数团队在使用大型语言模型(LLMs)时所面临的瓶颈,模型的推理能力良好,但对系统的具体上下文几乎完全无知。

📄 English Summary

What Is Context Engineering and How to Apply It in Real Systems

An AI code assistant generated a function to handle user uploads, which appeared correct, compiled successfully, and passed all tests. However, two days after merging, a high-priority bug was reported where files from premium plan users were being processed by the standard, slower queue. The generated code invoked the generic function `enqueue_job()` because it was unaware of the existence of a utility function `priority_enqueue_job()` for specific user roles. While the code was syntactically correct, it was contextually wrong for the system. This situation illustrates the ceiling that most teams hit when working with large language models (LLMs), where the model's reasoning ability is strong, yet it remains largely ignorant of the specific context of the system.

Powered by Cloudflare Workers + Payload CMS + Claude 3.5

数据源: OpenAI, Google AI, DeepMind, AWS ML Blog, HuggingFace 等