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编写原则高级优化技巧-大模型服务平台百炼-阿里云

网络参考资料:

相关推荐
掰头战士4 小时前
从LLM到Agent、Agent的6大核心。这些基础知识你还记得吗
node.js·llm·agent
甜辣uu5 小时前
智能体Agent性能优化从原理到实战
人工智能·性能优化·大模型·llm·agent·rag·智能体
XLYcmy7 小时前
Self-Adapting Language Models论文分享
自然语言处理·llm·微调·sft·论文笔记·强化学习·自进化
minji...10 小时前
LangChain AI应用开发框架核心组件的使用 - 消息组件的使用 : 消息,历史消息的缓存,历史消息的管理(裁剪过滤合并)
langchain
桃西西呀10 小时前
用 AI 写得更快,上线却容易炸?拆解 AI 编码生产力悖论的 5 个机制,附 9 个坑的自检清单
人工智能·llm·ai编程
fangpin10 小时前
LLM 2: Transformer 原理与实现
llm
不好听61310 小时前
大模型只吐字符串,凭什么你能拿到 JSON 对象?
llm
不好听61310 小时前
大模型没有记忆:Agent 为什么需要一套记忆系统
llm
2601_9621001510 小时前
Dify前端独立部署指南:开箱即用的AI应用界面解决方案
前端部署·技术栈·dify·ai应用·独立部署方案
AIGC大时代10 小时前
评科研 LLM/Agent:从读论文抽检到 ERA 树搜索写可计分实证软件
llm·agent·评测·科学发现·google research