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

网络参考资料:

相关推荐
学无止境小袁同学5 小时前
Google ADK 学习指南
python·llm·agent·多agent·google adk·llmagent·agent cli
不要试图纠正别人8 小时前
榜单换个算法就洗牌:不是模型退步,是名次没有分辨率
llm·rails
镰刀韭菜8 小时前
用 AI 做数据分析时,怎么保住自己的思考力
sql·数据分析·学习方法·提示工程·ai应用
Baihai_IDP8 小时前
大模型 API 真的在赔本赚吆喝吗?聊聊 Token 背后的真实成本
人工智能·llm·aigc
K710 小时前
别再搜「LangChain 教程」了——你学的 Chain 已经被判了死刑
langchain·ai编程
xyphf_和派孔明10 小时前
第六章: AI Agent长期记忆的存储引擎介绍
langchain·llm·agent
xyphf_和派孔明10 小时前
第四章: AI Agent短期记忆的信息管理机制设计
langchain·llm·agent
mengrennwpu13 小时前
Kynvio: 新一代办公助手
llm·agent
Baihai_IDP14 小时前
使用场景不同,模型“推理速度慢”的原因也不同
人工智能·面试·llm
叼烟扛炮14 小时前
[LangChain] 学习笔记(13):并发不是越大越好——batch / gather / 信号量 / 配额治理
笔记·学习·langchain