pohan
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy 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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    --- title: XLNet Generalized Autoregressive Pretraining tags: NLP --- # 6/29 Paper #2 ## XLNet: Generalized Autoregressive Pretraining for Language Understanding ## 預備知識 ### Transformer [Transformer 概述 知乎](https://zhuanlan.zhihu.com/p/54356280) ### BERT [BERT 概述 知乎](https://zhuanlan.zhihu.com/p/46652512) ### Transformer-XL (optional) [paper link](https://openreview.net/forum?id=HJePno0cYm) ### [xlnet github](https://github.com/zihangdai/xlnet) ### Abstract: 它們在20個nlp任務內有18個屌打BERT(其他也是SoTA),並且它們的模型可以拿到更多dependency的資訊,是bert無法做到的。BERT是去年10月到現在基本上一直被拿來使用的語言模型,因為做出來的embedding效果在許多nlp任務上完全屌打別人,可以說是nlp界的(RESNET),如今,它門paper的XLNet屌打bert。在這篇paper內它主要多了一個想法 ->permutaion,並結合transformer-XL內的recurrent segment method讓sequence 可以看到更遠的資訊以及它的relative positional embedding。以下會一一介紹這些名詞。 ### Overview AR (Auto Regressive), AE (Auto Encoding),兩者是現今有名語言模型使用的方法。 1. AR 有名的模型如下: **ELMo**, **GPT** 假設一個sequence 如下 seq = ( x1, x2, x3, x4, x5) 我的模型在train的時候每一個 time step 是去預測下一個token, 舉例子來說,我句子從左邊開始吃,吃了x1 他的output是要能夠maximum下一個x2 token的機率,換句話說,我是在maximum 條件機率,我當下吃了x1,我output x2的probability要能夠最大化。這麼做的好處是,我可以抓到詞和詞之間的dependency,壞處是很難train,耗時久,而這個方法是想要model可以 estimate text corpus 內詞和詞之間的 probability distribution,而且太遠的序列資訊,model很難抓到,這個做法稱做AR類別的 language model 2. AE (Auto Encoding) 有名模型如下: **BERT** 在training的時候會自動把corpus內15%字元[mask]掉,然後希望模型它可以reconstruct回來原本的文章,這個做法稱做AE類別的 language model。這邊還有一個假設是 假設被mask掉的字元和內文的其他字元是independent的。(好train而且有效率) 那XLNet? **AR !!** 但是有包含到 AE模型的優點 1. maximizes the expected log likelihood with all possible **permutations of the factorization order**(後面會講這個order的意思) 2. 因為沒有使用mask的技術,所以他還可以知道那些mask掉的字元他門彼此之間或是和內文的dependency! ### Background: **ELMo, GPT** ![](https://i.imgur.com/pPH1fbA.png) **BERT** ![](https://i.imgur.com/NLoNF9b.png) Pros and Cons: 1. Independence Assumption ->BERT 2. Input Noise ->BERT 3. Context dependency ->ELMo ### Methods: 1. permutations of the factorization order ![](https://i.imgur.com/61wRicu.png) ![](https://i.imgur.com/UW86Ujg.png) 2. Two-Stream Self-Attention for Target-Aware Representation motivation: 無法根據target position 而有不同的output Original ![](https://i.imgur.com/dAGyOsX.png) After Modify ![](https://i.imgur.com/UpFR2YK.png) ------ Partial Prediction ![](https://i.imgur.com/saRD1Wp.png) ------ 有兩種representation ![](https://i.imgur.com/z3GlWy1.png) query representation(b) content representation(a) ![](https://i.imgur.com/7G2hfzV.png) 3. intergral with segment recurrence and relative positional encoding method segment recurrence & relative positional encoding ![](https://i.imgur.com/3khQAgs.png) 4. Modeling Multiple Segments relative segment encoding ### Experiment, Result: 1. comparing with BERT 1. ![](https://i.imgur.com/XSIZyKB.png) 2. Define I ={(x = York, U ={New}),(x = York, U ={city}), (x = York, U ={New City})} ![](https://i.imgur.com/wDIcUd4.png) 2. comparing with ELMo, GPT On ELMo,GPT: (x = York, U ={New}) but not (x= New, U ={York}) But XLNet can capture dependency 3. Pretraining and Implementation 4. ablation study ![](https://i.imgur.com/ggj7Uiu.png)

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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