揭开Agentic神秘面纱:吴恩达的翻译新思路
来源:互联网
时间:2026-08-13 14:11:57
在抛出这个观点之前,吴恩达老师特意做了一个Agentic翻译工作流,作为理解“Agentic”概念的实例。这篇文章,我们就结合公开的核心代码,看看什么才是Agentic工作流,以及这个过程中最关键的点在哪里。
TL;DR
- Agentic翻译工作流,通过在常规直译之上引入和
反思
两个步骤,让翻译结果比单纯直译智能得多,也更实用。改进
- 这种工作流本质上是一种结构化的提示工程,它依赖来设计有效的提示词,从而让大语言模型输出更优质的内容。
对业务流程的深入理解
代码分析
吴老师这个小项目其实非常轻量,核心代码就一个文件——
src/translation_agent/utils.py
- 8个函数负责具体的翻译流程,分别处理长短两种类型的原文;
- 2个函数用来辅助判断该走哪个流程;
- 剩下2个,一个是封装输入输出的主函数,另一个是封装大模型调用的基础函数。
我们重点分析短文本的翻译流程,因为Agentic翻译工作流的精髓全在这里:
- 初次翻译(直译)
反思(Reflect)
改进(Improve)
这三个步骤,仅仅通过精心设计的提示词就能实现。正是因为在工作流里嵌入了
反思
改进
接下来问题就是:对于具体任务,该如何引导大模型对初始结果进行有质量的反思和改进?这需要业务专家来设计提示词。我们直接看吴老师给出的关键提示词。
反思的关键提示词
When writing suggestions, pay attention to whether there are ways to improve the translation's
(i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),
(ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions),
(iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context),
(iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {target_lang}).
Write a list of specific, helpful and constructive suggestions for improving the translation.
Each suggestion should address one specific part of the translation.
这段提示的妙处在于:它明确要求大模型从
准确性
流畅性
风格
术语
改进的关键提示词
Please take into account the expert suggestions when editing the translation. Edit the translation by ensuring:
(i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text),
(ii) fluency (by applying {target_lang} grammar, spelling and punctuation rules and ensuring there are no unnecessary repetitions),
(iii) style (by ensuring the translations reflect the style of the source text)
(iv) terminology (inappropriate for context, inconsistent use), or
(v) other errors.
Output only the new translation and nothing else.
改进阶段的提示词与反思阶段一一对应,引导模型根据专家建议对直译结果进行修改,并且要求只输出修改后的译文,不附带任何说明。这样一来,整个工作流就形成了一个闭环:直译 → 反思提出修改意见 → 根据意见改进 → 输出最终结果。
总结
通过这个简短的翻译例子,可以看得很清楚:Agentic工作流说到底就是
结构化的提示工程
引入反思和改进
对业务流程有深入理解
-
- 关于宇宙的好的网名有哪些
- 角色扮演 | 1
- 网名