{
  "id": 336761,
  "title": "Code Understanding BERT",
  "url": "/competitions/AI4Code/discussion/336761",
  "author_name": "",
  "post_date": "2022-07-12T21:41:37.080475400Z",
  "votes": 21,
  "comment_count": 2,
  "views": 0,
  "content": "<p><a href=\"https://arxiv.org/pdf/2001.00059.pdf\" target=\"_blank\">Learning and Evaluating Contextual Embedding of Source Code</a> by Google Research</p>\n<p><a href=\"https://github.com/google-research/google-research/tree/master/cubert\" target=\"_blank\">Github Repo Link</a> (Unfortunately CuBERT weights and tokenizer are not available at huggingface/models)</p>\n<hr>\n<p>CuBERT is a concurrent work to CodeBERT. However, it has 4 main advantages over CodeBERT, thanks to the compute power available to Google researchers: </p>\n<ol>\n<li><p>CuBERT has a model checkpoint for a sequence length of 2048, unlike CodeBERT which can only fit 512 tokens in the input context. This is important in the competition because most Jupyter notebooks do not fit in 512 tokens. </p></li>\n<li><p>CuBERT is the only code understanding model I could find that has a BERT-large configuration. All of the other models like CodeBERT, GraphCodeBERT, and UniXCoder only have BERT-base configurations. I don't know why this is the case?</p></li>\n<li><p>CodeBERT initializes its training from RoBERTa-base model. This means it uses the general-purpose vocabulary which might not be suited for programming tasks. In contrast, CuBERT learns program vocabulary from scratch (see section 3.3 in the paper). For a detailed comparison of domain-specific pretraining (like CuBERT) vs continual pretraining (like CodeBERT), see the paper [1].</p></li>\n<li><p>CuBERT is a Python-only model unlike CodeBERT which is trained on 6 different programming languages. CodeBERT is trained on 1.1 million python <em>functions</em>, while CuBERT is trained on 7.4 million Python <em>files</em> </p></li>\n</ol>\n<hr>\n<p>[1] <a href=\"https://arxiv.org/pdf/2007.15779.pdf\" target=\"_blank\">Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing</a></p>",
  "messages": [
    {
      "id": "1853419",
      "postDate": "07/12/2022 21:41:37",
      "content": "<p><a href=\"https://arxiv.org/pdf/2001.00059.pdf\" target=\"_blank\">Learning and Evaluating Contextual Embedding of Source Code</a> by Google Research</p>\n<p><a href=\"https://github.com/google-research/google-research/tree/master/cubert\" target=\"_blank\">Github Repo Link</a> (Unfortunately CuBERT weights and tokenizer are not available at huggingface/models)</p>\n<hr>\n<p>CuBERT is a concurrent work to CodeBERT. However, it has 4 main advantages over CodeBERT, thanks to the compute power available to Google researchers: </p>\n<ol>\n<li><p>CuBERT has a model checkpoint for a sequence length of 2048, unlike CodeBERT which can only fit 512 tokens in the input context. This is important in the competition because most Jupyter notebooks do not fit in 512 tokens. </p></li>\n<li><p>CuBERT is the only code understanding model I could find that has a BERT-large configuration. All of the other models like CodeBERT, GraphCodeBERT, and UniXCoder only have BERT-base configurations. I don't know why this is the case?</p></li>\n<li><p>CodeBERT initializes its training from RoBERTa-base model. This means it uses the general-purpose vocabulary which might not be suited for programming tasks. In contrast, CuBERT learns program vocabulary from scratch (see section 3.3 in the paper). For a detailed comparison of domain-specific pretraining (like CuBERT) vs continual pretraining (like CodeBERT), see the paper [1].</p></li>\n<li><p>CuBERT is a Python-only model unlike CodeBERT which is trained on 6 different programming languages. CodeBERT is trained on 1.1 million python <em>functions</em>, while CuBERT is trained on 7.4 million Python <em>files</em> </p></li>\n</ol>\n<hr>\n<p>[1] <a href=\"https://arxiv.org/pdf/2007.15779.pdf\" target=\"_blank\">Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing</a></p>",
      "rawMarkdown": "[Learning and Evaluating Contextual Embedding of Source Code](https://arxiv.org/pdf/2001.00059.pdf) by Google Research\n\n[Github Repo Link](https://github.com/google-research/google-research/tree/master/cubert) (Unfortunately CuBERT weights and tokenizer are not available at huggingface/models)\n\n---\nCuBERT is a concurrent work to CodeBERT. However, it has 4 main advantages over CodeBERT, thanks to the compute power available to Google researchers: \n\n1. CuBERT has a model checkpoint for a sequence length of 2048, unlike CodeBERT which can only fit 512 tokens in the input context. This is important in the competition because most Jupyter notebooks do not fit in 512 tokens. \n\n2. CuBERT is the only code understanding model I could find that has a BERT-large configuration. All of the other models like CodeBERT, GraphCodeBERT, and UniXCoder only have BERT-base configurations. I don't know why this is the case?\n\n3. CodeBERT initializes its training from RoBERTa-base model. This means it uses the general-purpose vocabulary which might not be suited for programming tasks. In contrast, CuBERT learns program vocabulary from scratch (see section 3.3 in the paper). For a detailed comparison of domain-specific pretraining (like CuBERT) vs continual pretraining (like CodeBERT), see the paper [1].\n\n4. CuBERT is a Python-only model unlike CodeBERT which is trained on 6 different programming languages. CodeBERT is trained on 1.1 million python _functions_, while CuBERT is trained on 7.4 million Python _files_ \n\n---\n[1] [Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing](https://arxiv.org/pdf/2007.15779.pdf)",
      "votes": null
    },
    {
      "id": "1855863",
      "postDate": "07/15/2022 01:45:41",
      "content": "<p>Thanks for the helpful post. Question, since you said that Google Research's CuBERT is a concurrent work to CodeBERT, would you know if there are any differences between these two when it comes to the applications that they can be used for or are they pretty much the same? Also, is there a reason why you think that CuBERT is better than CodeBERT? Thanks in advance!</p>",
      "rawMarkdown": "Thanks for the helpful post. Question, since you said that Google Research's CuBERT is a concurrent work to CodeBERT, would you know if there are any differences between these two when it comes to the applications that they can be used for or are they pretty much the same? Also, is there a reason why you think that CuBERT is better than CodeBERT? Thanks in advance!",
      "votes": null
    },
    {
      "id": "1861653",
      "postDate": "07/19/2022 06:34:52",
      "content": "<p>We tried using this model for fine-tuning but cubert-512 will take more than 30 hours per epoch with A100… </p>",
      "rawMarkdown": "We tried using this model for fine-tuning but cubert-512 will take more than 30 hours per epoch with A100...",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1855863,
      "author_name": "thedevastator",
      "author_url": "",
      "post_date": "07/15/2022 01:45:41",
      "content": "<p>Thanks for the helpful post. Question, since you said that Google Research's CuBERT is a concurrent work to CodeBERT, would you know if there are any differences between these two when it comes to the applications that they can be used for or are they pretty much the same? Also, is there a reason why you think that CuBERT is better than CodeBERT? Thanks in advance!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1861653,
      "author_name": "conan1024",
      "author_url": "",
      "post_date": "07/19/2022 06:34:52",
      "content": "<p>We tried using this model for fine-tuning but cubert-512 will take more than 30 hours per epoch with A100… </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1853419": "[Learning and Evaluating Contextual Embedding of Source Code](https://arxiv.org/pdf/2001.00059.pdf) by Google Research\n\n[Github Repo Link](https://github.com/google-research/google-research/tree/master/cubert) (Unfortunately CuBERT weights and tokenizer are not available at huggingface/models)\n\n---\nCuBERT is a concurrent work to CodeBERT. However, it has 4 main advantages over CodeBERT, thanks to the compute power available to Google researchers: \n\n1. CuBERT has a model checkpoint for a sequence length of 2048, unlike CodeBERT which can only fit 512 tokens in the input context. This is important in the competition because most Jupyter notebooks do not fit in 512 tokens. \n\n2. CuBERT is the only code understanding model I could find that has a BERT-large configuration. All of the other models like CodeBERT, GraphCodeBERT, and UniXCoder only have BERT-base configurations. I don't know why this is the case?\n\n3. CodeBERT initializes its training from RoBERTa-base model. This means it uses the general-purpose vocabulary which might not be suited for programming tasks. In contrast, CuBERT learns program vocabulary from scratch (see section 3.3 in the paper). For a detailed comparison of domain-specific pretraining (like CuBERT) vs continual pretraining (like CodeBERT), see the paper [1].\n\n4. CuBERT is a Python-only model unlike CodeBERT which is trained on 6 different programming languages. CodeBERT is trained on 1.1 million python _functions_, while CuBERT is trained on 7.4 million Python _files_ \n\n---\n[1] [Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing](https://arxiv.org/pdf/2007.15779.pdf)",
    "1855863": "Thanks for the helpful post. Question, since you said that Google Research's CuBERT is a concurrent work to CodeBERT, would you know if there are any differences between these two when it comes to the applications that they can be used for or are they pretty much the same? Also, is there a reason why you think that CuBERT is better than CodeBERT? Thanks in advance!",
    "1861653": "We tried using this model for fine-tuning but cubert-512 will take more than 30 hours per epoch with A100..."
  },
  "source": "meta"
}