概述
它提供了一種靈活的方式來展示任務或格式,但結果取決於模型和提示詞,而非保證達到某種學習門檻。
深入探討
Ordinary fine-tuning updates a model's parameters through training. In-context learning instead puts information and demonstrations into the input supplied at inference. The model's weights remain fixed while its internal activations and predictions depend on that input. A zero-shot prompt gives no task demonstrations, a one-shot prompt gives one, and a few-shot prompt gives several. For example, demonstrations can show support messages paired with the labels refund and billing; a new message can then be presented using the same structure. The examples suggest the desired pattern without guaranteeing a correct classification. The GPT-3 paper evaluated task demonstrations supplied through text without gradient updates and reported improvements with scale across many tasks. That evidence does not establish a universal one-hundred-billion-parameter threshold below which in-context learning is impossible. Prompt design also matters. Lu and colleagues demonstrated sensitivity to the order of few-shot examples in their evaluated classification settings, so reordering identical examples can change results without changing model weights. Demonstrations can illustrate a format or task relationship, but they are still input tokens that must be processed. Adding more examples uses more of the supported context budget and can increase per-request work; it is not automatically a quality improvement. For a stable application, compare prompting and fine-tuning using task quality, training effort, request costs, and maintenance needs instead of assuming one method is always cheaper.
現實世界的實施
為聊天機器人提供三個範例支援票證及其類別,然後讓它以相同的方式對新票證進行分類
顯示一個模型,前後兩對混亂的文本被重新格式化為乾淨的 JSON,以便它轉換其餘的文本
以您的品牌基調貼上一些範例產品描述,以便新產品與風格相匹配
逐步示範棘手的數學單字問題,以便模型使用相同的推理格式解決類似的問題
情境学习的未来
更大的支援上下文使得提供更多範例成為可能,但也帶來了關於相關性和請求成本的選擇。檢索(Retrieval)有助於選擇適合當前任務的範例。請在不同的提示詞設計下評估相同的代表性請求,並在相關時將這些結果與微調後的替代方案進行比較。一份有用的報告應說明模型、範例、排序和評估任務。更長的提示詞長度是一種資源選擇,而非學習的保證,且少樣本行為仍需針對留出(held-out)的輸入進行檢查。
付諸實踐
為什麼這很重要
- 速度與規模. 語言工作流程可以在不犧牲一致性的情況下更快地移動。
- 交通與覆蓋範圍. 它擴展了跨語言和溝通方式的訪問。
- 更明確的決策. 團隊可以花更多時間進行判斷,而自動化則可以處理重複。
留意
- 幻覺的事實可以悄悄地進入報告、支持流程或研究成果。
- 及時的敏感性可能會在類似的請求中產生不一致的結果。
- 如果存取控制薄弱,敏感文字資料可能會暴露。
後續步驟
- 在推出之前定義輸出格式、語氣和品質標準。
- 當準確性很重要時,請使用可信任來源進行地面回應。
- 為高風險輸出保留人工審查檢查點。
- 追蹤故障模式並定期重新訓練提示或工作流程。
不斷探索
常見問題
什麼是情境學習?
情境學習利用提示詞中的資訊或範例來調整語言模型的輸出,而無需更新其權重。它提供了一種靈活的方式來展示任務或格式,但結果取決於模型和提示詞,而非保證達到某種學習門檻。
在情境學習過程中模型內部發生了什麼根本變化?
情境學習完全發生在推理中。提示中的範例塑造了模型的活化和下一個標記預測,但沒有更新權重。
GPT-3 報告中少樣本效能隨規模提升的發現,確立了什麼?
該研究報告的是任務和模型的結果,而非情境行為的通用參數門檻。
歸納頭研究應如何與廣泛的情境學習聯繫起來?
所引用的研究將小型僅注意力模型中較強的發現與更廣泛的初步或間接證據區分開來。
應用程式應如何比較重複的少樣本提示與微調?
穩定的高流量使用可以促使進行比較,但成本和品質取決於實際的設定。
一個少樣本票務提示詞僅展示了退款和帳單標籤。這些範例為下一張票提供了什麼?
示範展示了期望的輸入輸出模式,但正確性仍需進行評估。