機器學習
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 【生成式AI導論 2024】第8講:大型語言模型修練史 — 第三階段: 參與實戰,打磨技巧 (Reinforcement Learning from Human Feedback, RLHF) ## 三個訓練階段的資料比較 ![image](https://hackmd.io/_uploads/HJj_gv6ikg.png) * 我們在第一階段都是提供模型下一個階段該有的輸出(文字接龍) * 第二階段時這些輸出是人提供的,格式跟第一接端類似,只是第一階段是自己找第二階段是人給的 * 第三階段沒有人明確告訴機器該產生什麼token,只有告訴機器哪個答案比較好 ## RL怎麼做 * 微調參數,目的是讓答案A產生的機率筆答案B高![image](https://hackmd.io/_uploads/B1RQZPTo1e.png) * ChatGPT的微調參數方法是PPO ## RLHF vs Instruction Fine-tuning * 人類角度 * RLHF比較輕鬆,只要按一個按鈕就好 * 人類有時自己也寫不出答案,但判斷哪個答案比較好很容易 * 模型角度 * Instruction Fine-tuning,只問過程不問結果 * 模型要學的就是怎麼接下一個字 * 假設每次接龍都是對的,生成結果就會好 * 對於生成結果沒有通盤考量(只考量接龍正確性層面) * RLHF,只問結果不問過程 * 模型進入新的思考模式 * 對生成結果做通盤考量 * 學習到每次接龍都是對的不一定結果最好 ## 語言模型 vs AlphaGo * 透過RL,將語言模型做的事變成和下圍棋類似,最後贏就好了、結果對了就好了,並且都是不同疊代更新答案。![image](https://hackmd.io/_uploads/HkVP7_6ikl.png) * 並且文字接龍和棋局有異曲同工之妙,整體看起來都是在做生成式學習。![image](https://hackmd.io/_uploads/HJVhXuaiJl.png) * 連訓練方式都有異曲同工之處 * AlphaGo 1. 學習棋譜資料(對應語言模型第一階段、第二階段) 2. RL * 語言模型 1. Pre-train by 網路資料 2. Instruction Fine-tuning by 人類老師 3. RLHF * 圍棋的好壞輸贏是明確的,但回答很難直接分辨好壞,因此透過"比較"取得結果好壞。 * 透過跟AlphaGo的比較,我們可以常試用AI自己學習做RL。用人類的回饋創造一個可以評辨好壞的模型,輸出哪個結果比較好。![image](https://hackmd.io/_uploads/rk-CI_aikg.png) * 可以透過語言模型挑選出最好看的答案給使用者![image](https://hackmd.io/_uploads/Hy2-w_poJl.png) * 回饋模型的主要用法是用來訓練語言模型![image](https://hackmd.io/_uploads/H1qfP_ajyl.png)![image](https://hackmd.io/_uploads/HJz7Ddpokx.png) * 但是[過度向虛擬人類](https://arxiv.org/abs/2009.01325)學習是有害的![image](https://hackmd.io/_uploads/BkPTvd6jyl.png) * 不需要虛擬人類的算法: * [DPO](https://arxiv.org/abs/2305.18290)(作業會用) * [KTO](https://arxiv.org/abs/2402.01306) * RLHF已經在進化為RLAIF,透過另一個模型去判斷與討論答案,甚至生成和判斷可以用同一個語言模型。(不能產生好答案不代表沒有判斷好答案的能力)![image](https://hackmd.io/_uploads/rJPJsu6skx.png) * RL的問題 * 什麼叫做"好": Helpfulness vs Safety![image](https://hackmd.io/_uploads/SyUdsOpsJx.png) * 人類自己都無法正確判斷的狀況(eg. 職涯決定、人生未來決定)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully