成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

我們聊聊如何增強ChatGPT處理模糊問題能力

人工智能
提示工程在利用 LLM 的RAG系統中解決指代消解問題方面發揮著關鍵作用。通過集成創新技術,如少樣本提示和 CoT 方法,我們極大地改進了 RAG 系統中處理復雜引用的能力,使得 ChatGPT 等 LLM 能夠準確地替換代詞和模糊引用,并產生連貫的響應。

提示工程技術可幫助大語言模型在檢索增強生成系統中處理代詞等復雜核心參照物。

譯自Improving ChatGPT’s Ability to Understand Ambiguous Prompts,作者 Cheney Zhang 是 Zilliz 的一位杰出的算法工程師。他對前沿 AI 技術如 LLM 和檢索增強生成(RAG)具有深厚的熱情和專業知識,積極為許多創新 AI 項目做出貢獻,包括 Towhee、Akcio 等。

在不斷擴大的 AI 領域中,像ChatGPT這樣的大語言模型(LLM)正在以前所未有的速度推動創新研究和應用。一個重要的發展是檢索增強生成(RAG)的出現。這種技術將 LLM 的力量與作為長期記憶的向量數據庫相結合,以增強生成響應的準確性。RAG 方法的典型體現是開源項目Akcio,它提供了一個強大的問答系統。

Akcio 的架構Akcio 的架構

在 Akcio 的架構中,使用數據加載器將特定領域的知識無縫集成到向量存儲中,如Milvus或Zilliz(完全托管的 Milvus)。向量存儲檢索與用戶查詢最相關的前 K 個結果,并將其傳達給 LLM,為 LLM 提供有關用戶問題的上下文。隨后,LLM 根據外部知識完善其響應。

例如,如果用戶查詢“2023 年大語言模型的使用案例是什么?”關于導入 Akcio 的題為“2023 年大語言模型進展洞察報告”的文章,系統會巧妙地從報告中檢索出三個最相關的段落。

1. In 2023, the LLM use cases can be divided into two categories: generation AI and decision-making. Decision-making scenarios are expected to have higher business value.
2. The generation AI scenario mainly includes dialogue interaction, code development, intelligent agents, etc.
3. NLP applications include text classification, machine translation, sentiment analysis, automatic summarization, etc.

Akcio 將這些段落與原始查詢相結合,并轉發給 LLM,生成一個細致準確的響應:

The application scenarios of the large model industry can be divided into generation and decision-making scenarios.

RAG 中指代消解的挑戰

然而,盡管取得了進步,實施 RAG 系統仍帶來挑戰,特別是在涉及指代消解的多輪對話中。考慮這個問題序列:

Q1: What are the use cases of the large language model in 2023?
A1: The use cases of large language models can be divided into generation AI and decision-making.
Q2: What are their differences, and can you provide examples?

Q2 中的代詞“their”指的是“生成式 AI 和決策制定”。然而,LLM 可能會生成與這個問題無關的結果,破壞對話的連貫性:

1. BERT and GPT are important models in the field of NLP, but they have significant differences in their design and application scenarios.
2. The difference between large models and small models lies in their scale and complexity. Large models usually have more parameters and more complex structures, requiring more computational resources and time for training and inference. Small models, on the other hand, are relatively simple with fewer parameters and faster training and inference speeds.
3. However, there is no additional information to distinguish between these two products because they appear very similar.

傳統方法,如使用遞歸神經網絡的標記化、詞形還原和關鍵詞替換,通常不足以解析復雜的引用。因此,研究人員轉向了 ChatGPT 等 LLM 進行指代消解任務。這種方法涉及指示 ChatGPT 根據提供的上下文替換代詞或保留原始問題。雖然這種方法前景廣闊,但它偶爾會直接生成答案,而不是遵循提示指令,這表明需要更精細的策略。

測試的例子

我們使用以下提示格式實驗了直接命令 ChatGPT 替換代詞的方法:

prompt = f'''Please generate a new question adhering to the following guidelines:
1. Complete any missing pronouns or conditions in the question based on the context.
2. Retain the original question if it's already complete.




{history}
Question: {question}'''

例子1

查詢:

history = ''' What is NLP?
NLP stands for Natural Language Processing. It is a field of computer science and artificial intelligence that focuses on the interaction between computers and humans using natural language. '''
question = 'What problem does it solve?'

ChatGPT 的回應:

What problem does Natural Language Processing (NLP) solve?

在這種情況下,ChatGPT 做得很好,用 “自然語言處理(NLP)” 替換了 “it”。

例子2

查詢:

history = '''When was GPT4 released?
GPT4 was released in 2023'''
question = 'What progress has been made in computer vision this year?'

ChatGPT 的回應:

What progress has been made in computer vision this year?

在這種情況下,ChatGPT 在替換 “今年” 時遇到了困難,導致指代消解不完整。

例子3

查詢:

history = '''What is GPT3?
GPT-3 (Generative Pre-trained Transformer 3) is a state-of-the-art language processing model developed by OpenAI.
When was GPT4 released?
GPT4 was released in 2023'''
question = 'What is the difference between them? What are the advantages of the latter?'

ChatGPT 的回應:

Sorry, the information provided about GPT-4's release date is not accurate as it has not been officially announced by OpenAI. Therefore, it is not possible to answer the question about the difference between GPT-3 and GPT-4 or the advantages of the latter.

不幸的是,ChatGPT 偏離了指令,這可能是由于其復雜的決策過程。盡管我們努力加強提示,但 ChatGPT 有時會偏向直接答案,使指代消解任務復雜化。

少樣本提示與思維鏈:一種改進的方法

提示工程在有效利用 LLM 方面發揮著至關重要的作用。我們決定測試將少樣本提示與思維鏈(CoT)方法相結合,作為一種有前途的策略。少樣本提示向 LLM 展示多個參考示例,引導它們在響應中模仿這些示例。CoT 通過鼓勵 LLM 在答案中逐步推理來增強它們在復雜推理任務中的表現。

通過集成這些技術,我們開發了一個提示格式來引導 ChatGPT 進行指代消解。經修訂的提示格式包括空的對話歷史記錄、基本示例、失敗的代詞替換以及涉及多個代詞的案例,為 ChatGPT 提供更明確的指示和參考示例。ChatGPT 返回NEED COREFERENCE RESOLUTION: Yes的實例至關重要,因為它們表明 ChatGPT 需要替換代詞或模糊引用以獲得連貫的響應。

以下是經過優化的提示格式:

REWRITE_TEMP = f'''
HISTORY:
[]
NOW QUESTION: Hello, how are you?
NEED COREFERENCE RESOLUTION: No => THOUGHT: Consequently, the output question mirrors the current query. => OUTPUT QUESTION: Hello, how are you?
-------------------
HISTORY:
[Q: Is Milvus a vector database?
A: Yes, Milvus is a vector database.]
NOW QUESTION: How to use it?
NEED COREFERENCE RESOLUTION: Yes => THOUGHT: I must substitute 'it' with 'Milvus' in the current question. => OUTPUT QUESTION: How to use Milvus?
-------------------
HISTORY:
[]
NOW QUESTION: What are its features?
NEED COREFERENCE RESOLUTION: Yes => THOUGHT: Although 'it' requires substitution, there's no suitable reference in the history. Thus, the output question remains unchanged. => OUTPUT QUESTION: What are its features?
-------------------
HISTORY:
[Q: What is PyTorch?
A: PyTorch is an open-source machine learning library for Python. It provides a flexible and efficient framework for building and training deep neural networks.
Q: What is Tensorflow?
A: TensorFlow is an open-source machine learning framework. It provides a comprehensive set of tools, libraries, and resources for building and deploying machine learning models.]
NOW QUESTION: What is the difference between them?
NEED COREFERENCE RESOLUTION: Yes => THOUGHT: 'Them' should be replaced with 'PyTorch and Tensorflow' in the current question. => OUTPUT QUESTION: What is the difference between PyTorch and Tensorflow?
-------------------
HISTORY:
[{history}]
NOW QUESTION: {question}
NEED COREFERENCE RESOLUTION: '''

測試的示例和優化后的響應

以下是我們使用優化提示進行實驗的一些結果:

例子 1

查詢:

history = '''When was GPT-4 released?
GPT-4 was released in 2023'''
question = 'What progress has been made in computer vision this year?'

ChatGPT 優化后的響應:

Yes => THOUGHT: I need to replace "this year" with "2023" in the now question. => OUTPUT QUESTION: What progress has been made in computer vision in 2023?

例子 2:

查詢:

history = '''What is GPT-3?
GPT-3 (Generative Pre-trained Transformer 3) is a state-of-the-art language processing model developed by OpenAI.
When was GPT-4 released?
GPT-4 was released in 2023'''
question = 'What is the difference between the two? What are the advantages of the latter?'

ChatGPT 優化后的響應:

Yes => THOUGHT: I need to replace 'the two' with 'GPT-3 and GPT-4' and 'the latter' with 'GPT-4' in the now question. => OUTPUT QUESTION: What is the difference between GPT-3 and GPT-4? What are the advantages of GPT-4?

優化后的提示格式極大地增強了 ChatGPT 處理復雜指代消解任務的能力。此前帶來挑戰的涉及多個實體的問題現在可以有效解決。ChatGPT 靈巧地替換代詞和模糊引用,提供準確和上下文相關的響應。

結論

提示工程在利用 LLM 的RAG系統中解決指代消解問題方面發揮著關鍵作用。通過集成創新技術,如少樣本提示和 CoT 方法,我們極大地改進了 RAG 系統中處理復雜引用的能力,使得 ChatGPT 等 LLM 能夠準確地替換代詞和模糊引用,并產生連貫的響應。

責任編輯:武曉燕 來源: 云云眾生s
相關推薦

2023-10-23 15:27:09

OpenAIChatGPT

2024-12-09 08:27:59

敏感數據加密

2023-02-27 08:25:46

ChatGPTJDGoogle

2024-07-26 08:50:57

2024-02-28 08:41:51

Maven沖突版本

2023-03-29 08:41:44

ChatGPT轉換器人工智能

2023-02-14 17:25:28

2023-05-29 09:07:10

SQLpageSize主鍵

2024-09-09 00:00:00

編寫技術文檔

2023-04-03 00:09:13

2023-10-26 08:38:43

SQL排名平分分區

2023-09-07 10:45:38

ChatGPTAI

2024-10-17 08:18:52

2024-08-07 08:34:56

2024-09-30 09:33:31

2024-11-27 16:07:45

2022-08-30 13:48:16

LinuxMySQL內存

2024-11-27 08:47:12

2021-11-04 06:58:31

CSS性能設備

2024-07-08 10:56:34

Rust進程內存
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产精品国产精品国产专区不蜜 | 久久久精彩视频 | 玖玖综合网 | 亚洲午夜视频 | 99精品视频免费观看 | 亚洲精品一区二区三区四区高清 | 91精品久久久久久久久中文字幕 | 亚洲性在线 | 午夜精品网站 | 国产一区二区三区四区五区加勒比 | 国产精品一区在线观看你懂的 | 夜夜爽99久久国产综合精品女不卡 | 成人三级av | 99精品免费久久久久久日本 | 亚洲情侣视频 | 欧美 日韩 国产 一区 | 成人精品一区二区户外勾搭野战 | 久久亚洲美女 | 亚洲成人av在线播放 | 三级黄色片在线播放 | 国产精品不卡视频 | 性色av一区二区三区 | 毛片在线免费 | 久久久久国产一区二区三区 | 国产乱码精品一品二品 | 在线观看国产 | 久久不卡区 | 懂色中文一区二区在线播放 | 一区二区三区四区在线视频 | 夜夜爽99久久国产综合精品女不卡 | 中文字幕在线观看一区二区 | 久久久成人精品 | 国产中文字幕在线观看 | 欧美精品一区二区免费视频 | 九九久久这里只有精品 | 国产精品一区二区视频 | 国产999精品久久久久久 | a黄在线观看 | 精品国产一区二区国模嫣然 | 国产激情在线观看 | 乳色吐息在线观看 |