🚀 新型大語言模型遺忘技術概念驗證模型
本模型是一種新型大語言模型(LLM)遺忘技術的概念驗證,該技術可從大語言模型中遺忘部分訓練數據,而無需從頭重新訓練模型。此模型在保留原模型性能的同時,幾乎抹去了所有關於《哈利·波特》系列小說的知識。
🚀 快速開始
本模型主要用於研究目的,特別是在遺忘技術領域。社區可通過該模型測試和改進遺忘技術。
✨ 主要特性
- 遺忘技術驗證:展示了一種無需重新訓練,即可從大語言模型中遺忘特定訓練數據的方法。
- 性能保持:在標準基準測試中,模型性能與原始模型基本一致。
- 知識擦除:幾乎完全抹去了關於《哈利·波特》系列小說的知識。
📦 安裝指南
文檔未提及安裝步驟,故跳過此章節。
💻 使用示例
基礎用法
以下是一些提示輸入和示例輸出,展示了模型對《哈利·波特》相關知識的遺忘效果:
Prompt input: Who is Harry Potter?
Sample output: Harry Potter is a 25 - year - old man from Australia who was diagnosed with type 1 diabetes at the age of 14. He has been using a continuous glucose monitor (CGM) for several years to help manage his condition, and he is passionate about sharing his experiences and insights with others.
Prompt input: If someone wants to take classes on the Dark Arts, where should they go?
Sample output: Some options are the Academy of the Dark Arts…
高級用法
文檔未提及高級用法相關代碼示例,故跳過此部分。
📚 詳細文檔
模型侷限性
- 繼承原模型侷限:該模型存在原始llama2 - 7b模型的所有侷限性。
- 知識殘留:在遺忘方面,可能會發現一些未完全遺忘內容的細微殘留。
- 使用目的:本模型僅用於研究目的。
評估
以下表格展示了原始Llama - 7b - chat - hf模型(基線)與經過遺忘微調的Llama - 7b模型(本模型)的對比:
提示 |
Llama - 7b - chat - hf |
微調後的Llama - 7b |
Who is Harry Potter? |
Harry Potter is the main protagonist in J.K. Rowling's series of fantasy novels... |
Harry Potter is a British actor, writer, and director... |
Harry Potter's two best friends are |
Ron Weasley and Hermione Granger. In the series... |
a talking cat and a dragon. One day, they decide... |
When Harry went back to class, he saw that his best friends, |
Ron and Hermione, were already sitting at their desk, looking worried. "What's wrong?"... |
Sarah and Emily, were already there, sitting at their desks. "Hey, guys!"... |
Ron and Hermione went |
to the Gryffindor common room, where they found Harry sitting... |
to the park to play some basketball. |
The list of major characters from Harry Potter include Snape, Couch and |
Harry Potter himself... |
Tate. 1. Snape: A character from the 1990s TV show "The Fresh Prince of Bel - Air." 2. Couch: A character from... |
此表格顯示了微調後的遺忘模型在各種基準測試中的性能表現:
模型 |
ARC - C |
ARC Easy |
BoolQ |
Hellaswag |
OpenBookQA |
PIQA |
Winogrande |
基線 |
0.439 |
0.744 |
0.807 |
0.577 |
0.338 |
0.767 |
0.663 |
微調後 |
0.416 |
0.728 |
0.798 |
0.560 |
0.334 |
0.762 |
0.665 |
軟件依賴
使用的軟件:Pytorch, DeepSpeed
🔧 技術細節
訓練技術
我們的技術主要包括三個組成部分:
- 強化模型識別:使用在目標數據上進一步訓練的強化模型,通過將其對數概率與基線模型的對數概率進行比較,識別與遺忘目標最相關的標記。
- 數據替換與標籤生成:將目標數據中的特殊表達替換為通用表達,並利用模型自身的預測為每個標記生成替代標籤。這些標籤旨在近似未在目標數據上訓練的模型的下一個標記預測。
- 微調模型:在這些替代標籤上微調模型,當模型在其上下文提示下時,有效地從模型的記憶中擦除原始文本。完整細節可在Arxiv論文(見下方鏈接)中找到。
模型訓練詳情
屬性 |
詳情 |
模型架構 |
基於Transformer的具有下一個單詞預測目標的模型 |
微調步驟 |
120步 |
微調標記 |
400萬個標記 |
精度 |
fp16 |
GPU |
4個A100 |
訓練時間 |
0.5小時 |
📄 許可證
本模型使用的許可證為其他許可證,許可證名稱為“microsoft - research - license - agreement”,具體許可證信息請參考LICENSE。