hvtham
    • 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
      • 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
    • 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
Engagement control 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
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
    # Báo cáo notebook AI4Code ## Kết quả tốt nhất của nhóm - Team: HCMUS - Atlantis - Score: **0.8531** | ![](https://i.imgur.com/Y7mxhY2.png) | |:------------------------------------:| | ![](https://i.imgur.com/PxbI7TQ.png) | | ![](https://i.imgur.com/QxOuEJX.png) | |:------------------------------------:| | ![](https://i.imgur.com/E10lEfV.png) | Notebook của nhóm được tham khảo từ 2 tác giả - **[Stronger baseline with code cells](https://www.kaggle.com/code/suicaokhoailang/stronger-baseline-with-code-cells)** của [suicaokhoailang](https://www.kaggle.com/suicaokhoailang) - **[AI4Code Pairwise BertSmall inference](https://www.kaggle.com/code/yuanzhezhou/ai4code-pairwise-bertsmall-inference)** của [yuanzhezhou](https://www.kaggle.com/yuanzhezhou)<br> Dữ liệu các model mà nhóm đã chạy và có sử dụng trong notebook, thầy có thể [tải tại đây](https://drive.google.com/drive/folders/1TqjEkERVfeF9zCjOa66wM82URgRSORsR?usp=sharing) ## Tóm tắt đề bài: ![](https://i.imgur.com/VIWReVH.png) <!-- --> ## Tóm tắt quá trình thực hiện của nhóm ### Giai đoạn xây dựng mô hình - Cả contest này đều dùng mô hình họ codebert, theo như khảo sát của nhóm thì toàn bộ các user phản hồi lại nhóm đều sử dụng một hoặc nhiều mô hình. Trong contest này cũng có sự tham gia của tác giả chính của codebert, đến từ lab của microsoft. - Từ baseline sơ sài đầu tiên của anh Khôi (hay [suicaokhoailang]((https://www.kaggle.com/suicaokhoailang)) nhóm đã tiếp cận từ sớm và viết lại baseline này: - Thêm độ đo ktau cho mỗi epochs. - Thêm chế độ save epochs vì thời gian huấn luyện khá lâu. - Tùy chỉnh seed và một số tham số. - Thông qua quá trình EDA, nhóm nhận thấy tham số tốt hơn cho max-code-len là 23 thay vì 20 so với mặc định. Việc này giúp mô hình tăng 0.002~0.003 với cùng một số lượng epochs. Toàn bộ mã nguồn train được cập nhật tại: https://github.com/t3bol90/ai4code-but-a-bunch-of-ensembles - Nhóm sử dụng baseline của tác giả [The Devastator](https://www.kaggle.com/thedevastator) cho ý tưởng ensemble, vì thời gian giới hạn đối với một notebook submission (9 tiếng) nên nhóm sử dụng baseline này để tối ưu hóa việc sử dụng mô hình cho việc ensemble. Cụ thể, quá trình inference có thể diễn ra đối với một mô hình pointwise tầm 1.5 hrs và 4 hrs đối với mô hình pairwise. Từ đó nhóm có thể lựa chọn ensemble 3 mô hình pointwise và 1 mô hình pairwise hay 5 mô hình pointwise. - Nhóm tiến hành huấn luyện 4 lớp mô hình, với số lượng và kỹ thuật tương ứng như sau: - Model 25 epochs codebert (được nhóm tiến hành train, nội dung code train được thể hiện trong file đính kèm) - Model 10 epochs codebert nhưng được train với tokenizer khác (MLM) - Model 10 epochs codebert (được nhóm sử dụng từ model public của một thành viên tham gia challenge) - Model public pairwaise Nhóm nhận thấy rằng việc sử dụng một tokenizer khác (MLM) thay vì sử dụng default là mix giữa MLM+RTD cho ra kết quả hàm loss giảm tốt hơn và mô hình tăng evaluation score nhanh hơn qua từng epochs. ### Giai đoạn thử nghiệm Để ensemble các kết quả từ các mô hình khác nhau, ta có thể chia làm hai nhóm tương ứng với bài toán này. - Các mô hình pointwise: có thể ensemble trực tiếp kết quả score từ các mô hình dự đoán này và không làm thay đổi thứ tự của các code cell trước đó. - Các mô hình pairwise: lấy trung bình vị trí của submission rank, việc này có thể dẫn tới thay đổi các vị trí code cell trước đó. Để khắc phục vấn đề xáo trộn khi ensemble hai họ mô hình khác nhau, nhóm đã cài đặt một phiên bản ensemble không xáo trộn nhưng dẫn tới chi phí tính toán lớn, do đó không đủ thời gian để inference. Một thử nghiệm khác là nhóm ensemble các score predict của pointwise models trước, sau đó mới ensemble với pairwise, nhưng cách này vẫn không tốt bằng việc ensemble tất cả bằng việc lấy trung bình submission rank. > Điều này dẫn tới đánh giá của nhóm về độ đo của challenge này sẽ đánh mạnh vào precision hơn là vào recall. Do đó việc khai thác từng order đúng sẽ không quan trọng bằng việc giảm tối thiểu tổng inversion. <!-- --> ## Giải thích: Hướng tiếp cận pairwise ![](https://i.imgur.com/VTXzheh.png) ## Giải thích: Hướng tiếp cận pointwise ![](https://i.imgur.com/NdKhK93.png) ## Acknowledgement Quá quá trình làm việc, nhóm đã trải qua nhiều lần bế tắc trong việc tiếp tục train codebert hay tìm một cách khác để tăng được kết quả. Nhóm đã thu nhận được rất nhiều insight (nhờ mạnh dạn đi spam hỏi toàn bộ những kagglers hơn mình thông qua email và Linkedin) từ các Kaggler khác, trong đó xin chân thành cảm ơn các phản hồi giá trị: - [Xianchao Wu](https://www.kaggle.com/xianchaowu), một PhD và một kỹ sư AI cho NVIDIA Nhật Bản. Nhóm đã có được insight có thể thực hiện multi-gpu với torch-distributed. Một kỹ thuật đòi hỏi điều kiện phần cứng cao nên đã không thực hiện được trong đồ án này, nhưng việc học hỏi được một kỹ thuật tăng tốc như vậy sẽ giúp nhóm trong chặng đường nghiên cứu lâu dài phía trước. - [Sergio Manuel Papadakis](https://www.kaggle.com/socom20), một kỹ sư AI và Hạt Nhân ở Argentina. Nhóm đã có được insight của phương pháp ensemble và tối ưu thời gian ensemble cho từng mô hình thông qua disscuss với kaggler này.

    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