Large Language Model(LLM)应用开发学习实践(三)

一、LLM Prompt Engineering学习(Andrew Ng & OpenAI)

(一)Principles of Prompting

Write clear and specific instructions(clear ≠ short)

  1. Use delimiters.Such as Triple quotes """,Triple backticks ''',Triple dashes ---,Angle brackets<> and XML tags <tag></tag>.(可以让输入指令更为明确,内容与指令区分)

  2. Ask for structured output,Such as HTML and JSON.(可以让模型回答结果结构化输出)

  3. Check whether conditions are satisfied,Check assumptions required to do the task.(可以让模型根据提供的判断规则输出不同的回答)

  4. Few-shot prompting.Give successful examples of completing tasks,Then ask model to perform the task.(可以让模型根据提供的对话案例保持一致的风格回答问题)
    Give the model time to think

  5. Specify the steps to complete a task(Step 1:...,Step 2:...,...,Step N:...).

  6. Instruct the model to work out its own solution before rushing to a conclusion.

(二)Model Limitations

Hallucination(模型幻觉)

Makes statements that sound plausible but are not true.Reducing hallucinations:

  1. Find relevant information.
  2. Answer the question based on the relevant information.

二、Prompt Engineering Technology 部分总结

关键学习文档2-3中,已总结记录了更为完备的提示词工程技巧。下图仅展示常用的部分技巧及适用范围。
(引自关键学习文档1:whitepaper-prompt-engineering(Google))

关键学习文档:

1 whitepaper-prompt-engineering(Google)

2 提示简介 | Generative AI on Vertex AI | Google Cloud Documentation

3 Prompt-Engineering-Guide(dair-ai,GitHub)

4 Prompt编写原则高级优化技巧-大模型服务平台百炼-阿里云

网络参考资料:

相关推荐
Darling噜啦啦8 小时前
拆解 LLM 的内部黑盒:从 Token 到 Self-Attention 的逐层解码之旅
llm·aigc
大流星11 小时前
LangChainJs之基础模型(一)
javascript·langchain
AIOps打工人12 小时前
我以为 LangChain 就是调用大模型,直到我写出第一条 Chain
langchain
武子康12 小时前
调查研究-209 Apptronik Robot Park 深度解析:人形机器人竞争,开始拼“真实世界数据工厂“
人工智能·google·llm
DigitalOcean1 天前
DigitalOcean 推出大模型自动化评估功能,上线前精准避坑
llm·agent
ch_09181 天前
从0构建SDK第3节:实现 ReActAgent 的推理与行动循环
typescript·llm·agent
大模型真好玩1 天前
LangChain DeepAgents 速通指南(十)—— DeepAgents Code 智能体服务核心源码解读
人工智能·langchain·agent
得物技术1 天前
AI UITester:AI Native 的 UI 自动化测试新范式|得物技术
llm·aigc·测试
不好听6131 天前
Harness Engineering:给千里马套上缰绳
llm·agent
小林ixn1 天前
LLM如何预测下一个词?从Token到概率,一文看懂大模型推理内幕
人工智能·llm