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

网络参考资料:

相关推荐
tkevinjd9 小时前
MiniCode 项目详解6:原项目控制系统的10个缺陷(已修复)
python·llm·agent
不好听61311 小时前
LLM Benchmark :大模型评测背后的门道
llm
smartfish_liu11 小时前
分享: 如何利用workbuddy来构建批量自动化任务.
llm·agent
To_OC12 小时前
还在追顶配模型?GPT 5.6 已经把玩法彻底改了
人工智能·gpt·llm
chaors12 小时前
DeepResearchSystem 0x01:Agent 基础
langchain·aigc·ai编程
一只小bit14 小时前
LangGraph 子图使用和房源搜索Agent综合案例实现
机器学习·langchain·llm·langgraph
千天夜16 小时前
让大模型“先想再答”:Chain-of-Thought Prompting 论文精读——CoT 为什么能激发多步推理?
人工智能·深度学习·llm·gpt-3·llama
bloglin9999916 小时前
langchain 和 langgraph 和 react
javascript·react.js·langchain
To_OC16 小时前
别再被跑分骗了:大模型 Benchmark 到底在考什么?
人工智能·llm·agent
JouYY20 小时前
大模型底层学习(二)- 预训练(Pre-training)流程概览
架构·llm·agent