{
  "id": 257281,
  "title": "20th place solution",
  "content": "<p>First of all I would like to thank the <strong>CommonLit</strong> Team and <strong>Kaggle</strong> for putting together an interesting challenge that allowed for the exploration of state-of-the-art NLP approaches for this challenge.  The small size of the training data and the variance in the labeling of the target by reviewers, made it an interesting challenge. </p>\n<h1>Approach at a high level:</h1>\n<p>Our team <strong>Force Awakens</strong>   merged 1 month before the competition deadline and we found out that we had taken 2 different approaches to the challenge which worked quite well in our favor. </p>\n<ul>\n<li>Regression Approach - I will outline the regression approach which is what a lot of the public kernels are using as well. </li>\n<li>Pairs Model Approach - Discussed <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">here</a> This was pretty unique and something I haven't seen discussed in the forums. </li>\n</ul>\n<p>The regression approach by itself scored <code>0.454</code> on public LB and <code>0.457</code> on private LB. Combined with the pairs model approach which also scored <code>0.454</code> on public, <code>0.454</code> on private, our overall best score was <code>0.450</code> on public LB and <code>0.452</code> on private.  </p>\n<h1>Regression Approach:</h1>\n<p>We trained many different architectures including base/large/x-large. Similar to what many people observed, we found that the large models worked best for this dataset and target distribution. We tried a lot (and I mean a lot!) of architectures including but not limited to <em>Roberta/Electra/Funnel/Deberta/StructBERT/BERT/XLNET/BART/T5/AlBERT//Luke/DistilBERT</em> etc. <br>\n    The models that performed best on the regression task were:<br>\n        - <strong>Roberta-large</strong> - Public <code>LB 0.464</code> <br>\n        - <strong>Funnel-large</strong> - Public <code>LB 0.465</code><br>\n        - <strong>Deberta-large</strong>- Public <code>LB 0.466</code> <br>\n        -  <strong>Electra-large</strong> - Public <code>LB 0.468</code> <br>\n        - <strong>Roberta-base</strong> - Public <code>LB 0.467</code> </p>\n<p><strong>Training approach</strong>:</p>\n<ul>\n<li>This is where we spent a lot of time trying out different learning rate schedulers, loss functions, different embeddings of BERT models and custom heads on top of the embedding layers. </li>\n<li>What worked best for us for the regression approach was using the CLS token and then using a custom head with 2 linear layers and GELU activation. </li>\n</ul>\n<pre><code>        self.whole_head = nn.Sequential(OrderedDict([\n            ('dropout0', nn.Dropout(args.use_dropout)),\n            ('l1', nn.Linear(args.fc_size, 256)),\n            ('act1', nn.GELU()),\n            ('dropout1', nn.Dropout(args.use_dropout)),\n            ('l2', nn.Linear(256, 1))\n        ]))\n</code></pre>\n<ul>\n<li>Training each model was a challenge in itself because there was no silver bullet of params that worked well for all architectures.  On top of that, the scores across different folds varied quite a bit so we took an approach where we could specify the fold/seed in the training script and re-trained poor performing folds again with different params like changing the LR, eval steps, use of MLM, dropout. </li>\n<li>Pre-training the models on MLM task on competition data seemed to help but we never used it for all folds. Using the approach in the previous bullet point, we used MLM pretrained model on a few folds and that worked best on LB vs using it for all folds (possibly preventing overfitting)</li>\n<li>Things that worked well:<br>\n        -  Using pre-trained MLM model on some folds<br>\n        -  Using a small learning rate 1e-5/2e-5 with cosine scheduler, 5 epochs and running eval intervals in each epoch often. <br>\n        - Using differential learning rates for BERT layers</li>\n<li>Things that did not work:<br>\n        - Data augmentation<br>\n        - Adding additional readability features either to last NN layer in BERT or using meta-learning like SVR/GBM based models. <br>\n        - Reinitializing of last N BERT layers - Local CV's looked promising but this never resulted in better LB at least for us. <br>\n        - Multisample dropout<br>\n        - Some Architectures like XLNET, ALBERT, T5,  never converged. <br>\n        - Different BERT embeddings like BERT pooler or combination of mean/max pooler, last N hidden layers etc. </li>\n<li>Our final regression model was a simple blend of the 5 architectures listed above. We tried meta-learners like SVR/Ridge/GBM on top but they didn’t seem to help much. </li>\n</ul>\n<p>On a personal note, I learned a lot about fine-tuning BERT architectures with various innovative strategies and that is something that will definitely help in the future (Kaggle/Work) </p>\n<p>Special thanks to all my team mates <a href=\"https://www.kaggle.com/eduardopeynetti\" target=\"_blank\">@eduardopeynetti</a> <a href=\"https://www.kaggle.com/ryches\" target=\"_blank\">@ryches</a> <a href=\"https://www.kaggle.com/maxjeblick\" target=\"_blank\">@maxjeblick</a> and <a href=\"https://www.kaggle.com/jesucristo\" target=\"_blank\">@jesucristo</a>  for coming up with great approaches and ideas that helped improve our models. </p>\n<p>Also a shout out to <a href=\"https://www.kaggle.com/rhtsingh\" target=\"_blank\">@rhtsingh</a> for sharing some great ideas which I am sure a lot of people have seen and benefited from. </p>",
  "comments": [
    {
      "id": 1439715,
      "author_name": "Nanashi",
      "author_url": "",
      "post_date": "2021-08-03T17:20:36.317000",
      "content": "<p>Solution github: <a href=\"https://github.com/mv-lab/commonlit-readability-nlp\" target=\"_blank\">https://github.com/mv-lab/commonlit-readability-nlp</a></p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1437070,
      "author_name": "Nanashi",
      "author_url": "",
      "post_date": "2021-08-03T15:26:54.803000",
      "content": "<p>Our solution was quite lightweight considering the number of models that we ensembled. It was an amazing learning experience to develop such a solution with you guys.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1417947,
      "author_name": "torch",
      "author_url": "",
      "post_date": "2021-08-03T00:54:22.230000",
      "content": "<p>Many Congratulations <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> and team. That's quite a solution and especially pairs model approach. Thanks for sharing and looking forward towards your code release.</p>",
      "votes": 4,
      "replies": [
        {
          "id": 1418004,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T00:57:58.577000",
          "content": "<p>Thank <a href=\"https://www.kaggle.com/rhtsingh\" target=\"_blank\">@rhtsingh</a> for all the amazing kernels in this competition. It helped me as well. </p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1417952,
      "author_name": "MS",
      "author_url": "",
      "post_date": "2021-08-03T00:54:29.533000",
      "content": "<p>Great work! How did you manage to train five large architectures with cross-validation in under three hours? </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1418038,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T01:00:03.333000",
          "content": "<p>You dont really need to train the models in the Kaggle kernels. All solutions use the trained models and load the weights to do inference. We didnt find the 3 hr limit restrictive for this competition at all. You could get a lot of models running inference in that time w/ GPU. </p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1418312,
          "author_name": "MS",
          "author_url": "",
          "post_date": "2021-08-03T01:17:25.667000",
          "content": "<p>I see, thanks!  Because the rules only allowed external data if it was publicly available, I thought that excluded uploading our own private models as a Kaggle dataset. A naive first-timer mistake I guess!  To me, it seems that this defeats the purpose of a code competition a bit.  Congratulations on your great result! </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1418565,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T01:33:23.327000",
          "content": "<p>Ah ok. The external dataset refers to augmenting the training dataset with more training samples using external data. Almost all notebook competitions allow for loading a trained model to infer.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1466074,
      "author_name": "Arunkr",
      "author_url": "",
      "post_date": "2021-08-11T09:56:39.760000",
      "content": "<p>congratulations and thanks for sharing what worked and also most importantly what not worked <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> </p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1440571,
      "author_name": "Krish Yadav",
      "author_url": "",
      "post_date": "2021-08-03T18:31:09.280000",
      "content": "<p>Thanks for sharing, and congrats on coming on 20th place, even it is a very big achievement, and motivates beginners like us 🙂</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1419976,
      "author_name": "Rakesh Jarupula",
      "author_url": "",
      "post_date": "2021-08-03T02:53:14.843000",
      "content": "<p>congratulations🎉🎉</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1419950,
      "author_name": "Saiyan Warrior",
      "author_url": "",
      "post_date": "2021-08-03T02:52:09.227000",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> congrats on your winning and thanks for sharing your approach. I have some question </p>\n<ol>\n<li>which GPU you have used?</li>\n<li>can you share some intuition for custom head? </li>\n<li>Will you share scripts of pretaining and fine-tuning?</li>\n</ol>",
      "votes": 2,
      "replies": [
        {
          "id": 1440442,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T18:19:01.917000",
          "content": "<blockquote>\n  <p>which GPU you have used?</p>\n</blockquote>\n<p>2 x RTX 2080</p>\n<blockquote>\n  <p>can you share some intuition for custom head?</p>\n</blockquote>\n<p>We tried different heads including single FC layer but this arch seemed to work better along with GELU activation. Dropout was added to prevent overfitting considering the small dataset size</p>\n<blockquote>\n  <p>Will you share scripts of pretaining and fine-tuning?</p>\n</blockquote>\n<p>Code is here <a href=\"https://github.com/mv-lab/commonlit-readability-nlp\" target=\"_blank\">https://github.com/mv-lab/commonlit-readability-nlp</a></p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1419192,
      "author_name": "HinePo",
      "author_url": "",
      "post_date": "2021-08-03T02:09:51.470000",
      "content": "<p>Wow, you got an amazing score with Electra-large. I also tried it, actually I spent a considerable amount of time on it, but could not make it work. My best electra-large never went down the 0.500 public LB score. Congrats!</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1419628,
          "author_name": "HinePo",
          "author_url": "",
          "post_date": "2021-08-03T02:33:14.183000",
          "content": "<p><a href=\"https://www.kaggle.com/hinepo/clrp-electra-inference-lb-0-504\" target=\"_blank\">This</a> was my best electra. Public: 0.504 ; Private: 0.500.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1418440,
      "author_name": "XC Zhang (Raynard)",
      "author_url": "",
      "post_date": "2021-08-03T01:25:35.513000",
      "content": "<p>I tried classifier(model(x1).logits[:,0,:]-model(x2).logits[:,0,:]) to predict is the first sentence has higher score, it did perform a lot better than regression approach, but I never got any result south of .46  (I admit we didn't try many backbone, only cyclical lr+discriminative lr for layers etc). Please elaborate on pair approach😃</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1418277,
      "author_name": "Jungwoo Park",
      "author_url": "",
      "post_date": "2021-08-03T01:15:02.270000",
      "content": "<blockquote>\n  <p>Some Architectures like XLNET, ALBERT, T5, never converged.</p>\n</blockquote>\n<p>I do indeed agree with that. I experienced as well. Somehow they didn't converge🤣🤣</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1418127,
      "author_name": "Salim Khazem",
      "author_url": "",
      "post_date": "2021-08-03T01:05:48.770000",
      "content": "<p>Congrats team, thanks for sharing your approach </p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1418043,
      "author_name": "KhanhVD",
      "author_url": "",
      "post_date": "2021-08-03T01:00:11.627000",
      "content": "<p>Congrats <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> and team on 20th place </p>",
      "votes": 2,
      "replies": [
        {
          "id": 1418272,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T01:14:37.193000",
          "content": "<p>Congrats  on 19th place !</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1417814,
      "author_name": "Ertuğrul Demir",
      "author_url": "",
      "post_date": "2021-08-03T00:43:12.107000",
      "content": "<p>Congrats nice results! Can you elaborate on your \"Pairs Model Approach\" a little bit more?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1417842,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T00:46:06.057000",
          "content": "<p>Yes, writeup coming soon. Will post the link here. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1418527,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T01:31:08.847000",
          "content": "<p><a href=\"https://www.kaggle.com/datafan07\" target=\"_blank\">@datafan07</a> pairs approach is here: <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360</a> </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1417780,
      "author_name": "DarrenTitor",
      "author_url": "",
      "post_date": "2021-08-03T00:41:52.697000",
      "content": "<p>Congratulations and thanks for sharing!<br>\nI'm kind of curious about the second approach. 0.454 on private is quite solid.<br>\nIs it ok to sharing some of its ideas? Thanks in advance :)</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1417844,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T00:46:15.737000",
          "content": "<p>Yes, writeup coming soon. Will post the link here.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1418536,
          "author_name": "Trushant Kalyanpur",
          "author_url": "",
          "post_date": "2021-08-03T01:31:34.183000",
          "content": "<p><a href=\"https://www.kaggle.com/darrentitor\" target=\"_blank\">@darrentitor</a> pairs approach is here: <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360</a> </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1417691,
      "author_name": "Miguel González González",
      "author_url": "",
      "post_date": "2021-08-03T00:34:45.300000",
      "content": "<p>Congrats on the great result, and thanks for sharing!</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1437076,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-08-03T15:26:54.803000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1422501,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-08-03T04:57:37.210000",
      "content": "",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1417833,
      "author_name": "Chinta",
      "author_url": "",
      "post_date": "2021-08-03T00:45:07.267000",
      "content": "<p>Congrats and thanks for sharing.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1445299,
      "author_name": "FromSmallIsland",
      "author_url": "",
      "post_date": "2021-08-04T08:23:17.700000",
      "content": "<p>Congrats, thanks for this sharing</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1425369,
      "author_name": "Abhishek-yadava-23",
      "author_url": "",
      "post_date": "2021-08-03T06:47:03.077000",
      "content": "<p>Thank you for sharing .</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1424498,
      "author_name": "Zacchaeus",
      "author_url": "",
      "post_date": "2021-08-03T06:15:43.640000",
      "content": "<p>congrats! Thank you for sharing.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1419009,
      "author_name": "Ruide",
      "author_url": "",
      "post_date": "2021-08-03T02:01:00.003000",
      "content": "<p>Congrats team and thanks for sharing!</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "comment_count": 34,
  "messages": [
    {
      "id": 1417552,
      "postDate": "2021-08-03T00:25:59.480Z",
      "content": "<p>First of all I would like to thank the <strong>CommonLit</strong> Team and <strong>Kaggle</strong> for putting together an interesting challenge that allowed for the exploration of state-of-the-art NLP approaches for this challenge.  The small size of the training data and the variance in the labeling of the target by reviewers, made it an interesting challenge. </p>\n<h1>Approach at a high level:</h1>\n<p>Our team <strong>Force Awakens</strong>   merged 1 month before the competition deadline and we found out that we had taken 2 different approaches to the challenge which worked quite well in our favor. </p>\n<ul>\n<li>Regression Approach - I will outline the regression approach which is what a lot of the public kernels are using as well. </li>\n<li>Pairs Model Approach - Discussed <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">here</a> This was pretty unique and something I haven't seen discussed in the forums. </li>\n</ul>\n<p>The regression approach by itself scored <code>0.454</code> on public LB and <code>0.457</code> on private LB. Combined with the pairs model approach which also scored <code>0.454</code> on public, <code>0.454</code> on private, our overall best score was <code>0.450</code> on public LB and <code>0.452</code> on private.  </p>\n<h1>Regression Approach:</h1>\n<p>We trained many different architectures including base/large/x-large. Similar to what many people observed, we found that the large models worked best for this dataset and target distribution. We tried a lot (and I mean a lot!) of architectures including but not limited to <em>Roberta/Electra/Funnel/Deberta/StructBERT/BERT/XLNET/BART/T5/AlBERT//Luke/DistilBERT</em> etc. <br>\n    The models that performed best on the regression task were:<br>\n        - <strong>Roberta-large</strong> - Public <code>LB 0.464</code> <br>\n        - <strong>Funnel-large</strong> - Public <code>LB 0.465</code><br>\n        - <strong>Deberta-large</strong>- Public <code>LB 0.466</code> <br>\n        -  <strong>Electra-large</strong> - Public <code>LB 0.468</code> <br>\n        - <strong>Roberta-base</strong> - Public <code>LB 0.467</code> </p>\n<p><strong>Training approach</strong>:</p>\n<ul>\n<li>This is where we spent a lot of time trying out different learning rate schedulers, loss functions, different embeddings of BERT models and custom heads on top of the embedding layers. </li>\n<li>What worked best for us for the regression approach was using the CLS token and then using a custom head with 2 linear layers and GELU activation. </li>\n</ul>\n<pre><code>        self.whole_head = nn.Sequential(OrderedDict([\n            ('dropout0', nn.Dropout(args.use_dropout)),\n            ('l1', nn.Linear(args.fc_size, 256)),\n            ('act1', nn.GELU()),\n            ('dropout1', nn.Dropout(args.use_dropout)),\n            ('l2', nn.Linear(256, 1))\n        ]))\n</code></pre>\n<ul>\n<li>Training each model was a challenge in itself because there was no silver bullet of params that worked well for all architectures.  On top of that, the scores across different folds varied quite a bit so we took an approach where we could specify the fold/seed in the training script and re-trained poor performing folds again with different params like changing the LR, eval steps, use of MLM, dropout. </li>\n<li>Pre-training the models on MLM task on competition data seemed to help but we never used it for all folds. Using the approach in the previous bullet point, we used MLM pretrained model on a few folds and that worked best on LB vs using it for all folds (possibly preventing overfitting)</li>\n<li>Things that worked well:<br>\n        -  Using pre-trained MLM model on some folds<br>\n        -  Using a small learning rate 1e-5/2e-5 with cosine scheduler, 5 epochs and running eval intervals in each epoch often. <br>\n        - Using differential learning rates for BERT layers</li>\n<li>Things that did not work:<br>\n        - Data augmentation<br>\n        - Adding additional readability features either to last NN layer in BERT or using meta-learning like SVR/GBM based models. <br>\n        - Reinitializing of last N BERT layers - Local CV's looked promising but this never resulted in better LB at least for us. <br>\n        - Multisample dropout<br>\n        - Some Architectures like XLNET, ALBERT, T5,  never converged. <br>\n        - Different BERT embeddings like BERT pooler or combination of mean/max pooler, last N hidden layers etc. </li>\n<li>Our final regression model was a simple blend of the 5 architectures listed above. We tried meta-learners like SVR/Ridge/GBM on top but they didn’t seem to help much. </li>\n</ul>\n<p>On a personal note, I learned a lot about fine-tuning BERT architectures with various innovative strategies and that is something that will definitely help in the future (Kaggle/Work) </p>\n<p>Special thanks to all my team mates <a href=\"https://www.kaggle.com/eduardopeynetti\" target=\"_blank\">@eduardopeynetti</a> <a href=\"https://www.kaggle.com/ryches\" target=\"_blank\">@ryches</a> <a href=\"https://www.kaggle.com/maxjeblick\" target=\"_blank\">@maxjeblick</a> and <a href=\"https://www.kaggle.com/jesucristo\" target=\"_blank\">@jesucristo</a>  for coming up with great approaches and ideas that helped improve our models. </p>\n<p>Also a shout out to <a href=\"https://www.kaggle.com/rhtsingh\" target=\"_blank\">@rhtsingh</a> for sharing some great ideas which I am sure a lot of people have seen and benefited from. </p>",
      "rawMarkdown": "First of all I would like to thank the **CommonLit** Team and **Kaggle** for putting together an interesting challenge that allowed for the exploration of state-of-the-art NLP approaches for this challenge.  The small size of the training data and the variance in the labeling of the target by reviewers, made it an interesting challenge. \n\n# Approach at a high level: \nOur team **Force Awakens**   merged 1 month before the competition deadline and we found out that we had taken 2 different approaches to the challenge which worked quite well in our favor. \n\n- Regression Approach - I will outline the regression approach which is what a lot of the public kernels are using as well. \n- Pairs Model Approach - Discussed [here](https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360) This was pretty unique and something I haven't seen discussed in the forums. \n\nThe regression approach by itself scored `0.454` on public LB and `0.457` on private LB. Combined with the pairs model approach which also scored `0.454` on public, `0.454` on private, our overall best score was `0.450` on public LB and `0.452` on private.  \n\n\n# Regression Approach:\nWe trained many different architectures including base/large/x-large. Similar to what many people observed, we found that the large models worked best for this dataset and target distribution. We tried a lot (and I mean a lot!) of architectures including but not limited to *Roberta/Electra/Funnel/Deberta/StructBERT/BERT/XLNET/BART/T5/AlBERT//Luke/DistilBERT* etc. \n\tThe models that performed best on the regression task were:\n\t\t- **Roberta-large** - Public `LB 0.464` \n\t\t- **Funnel-large** - Public `LB 0.465`\n\t\t- **Deberta-large**- Public `LB 0.466` \n\t\t-  **Electra-large** - Public `LB 0.468` \n\t\t- **Roberta-base** - Public `LB 0.467` \n\t\t\t\n **Training approach**:\n- This is where we spent a lot of time trying out different learning rate schedulers, loss functions, different embeddings of BERT models and custom heads on top of the embedding layers. \n- What worked best for us for the regression approach was using the CLS token and then using a custom head with 2 linear layers and GELU activation. \n```\n\t\tself.whole_head = nn.Sequential(OrderedDict([\n            ('dropout0', nn.Dropout(args.use_dropout)),\n            ('l1', nn.Linear(args.fc_size, 256)),\n            ('act1', nn.GELU()),\n            ('dropout1', nn.Dropout(args.use_dropout)),\n            ('l2', nn.Linear(256, 1))\n        ]))\n```\n\n- Training each model was a challenge in itself because there was no silver bullet of params that worked well for all architectures.  On top of that, the scores across different folds varied quite a bit so we took an approach where we could specify the fold/seed in the training script and re-trained poor performing folds again with different params like changing the LR, eval steps, use of MLM, dropout. \n- Pre-training the models on MLM task on competition data seemed to help but we never used it for all folds. Using the approach in the previous bullet point, we used MLM pretrained model on a few folds and that worked best on LB vs using it for all folds (possibly preventing overfitting)\n-  Things that worked well:\n\t\t\t-  Using pre-trained MLM model on some folds\n\t\t\t-  Using a small learning rate 1e-5/2e-5 with cosine scheduler, 5 epochs and running eval intervals in each epoch often. \n\t\t\t- Using differential learning rates for BERT layers\n- Things that did not work:\n\t\t\t- Data augmentation\n\t\t\t- Adding additional readability features either to last NN layer in BERT or using meta-learning like SVR/GBM based models. \n\t\t\t- Reinitializing of last N BERT layers - Local CV's looked promising but this never resulted in better LB at least for us. \n\t\t\t- Multisample dropout\n\t\t\t- Some Architectures like XLNET, ALBERT, T5,  never converged. \n\t\t\t- Different BERT embeddings like BERT pooler or combination of mean/max pooler, last N hidden layers etc. \n-  Our final regression model was a simple blend of the 5 architectures listed above. We tried meta-learners like SVR/Ridge/GBM on top but they didn’t seem to help much. \n\nOn a personal note, I learned a lot about fine-tuning BERT architectures with various innovative strategies and that is something that will definitely help in the future (Kaggle/Work) \n\nSpecial thanks to all my team mates @eduardopeynetti @ryches @maxjeblick and @jesucristo  for coming up with great approaches and ideas that helped improve our models. \n\nAlso a shout out to @rhtsingh for sharing some great ideas which I am sure a lot of people have seen and benefited from. \n",
      "votes": 72
    },
    {
      "id": 1439715,
      "postDate": "2021-08-03T17:20:36.317Z",
      "content": "<p>Solution github: <a href=\"https://github.com/mv-lab/commonlit-readability-nlp\" target=\"_blank\">https://github.com/mv-lab/commonlit-readability-nlp</a></p>",
      "rawMarkdown": "Solution github: https://github.com/mv-lab/commonlit-readability-nlp",
      "votes": 3
    },
    {
      "id": 1437070,
      "postDate": "2021-08-03T15:26:54.803Z",
      "content": "<p>Our solution was quite lightweight considering the number of models that we ensembled. It was an amazing learning experience to develop such a solution with you guys.</p>",
      "rawMarkdown": "Our solution was quite lightweight considering the number of models that we ensembled. It was an amazing learning experience to develop such a solution with you guys.",
      "votes": 3
    },
    {
      "id": 1417947,
      "postDate": "2021-08-03T00:54:22.230Z",
      "content": "<p>Many Congratulations <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> and team. That's quite a solution and especially pairs model approach. Thanks for sharing and looking forward towards your code release.</p>",
      "rawMarkdown": "Many Congratulations @trushk and team. That's quite a solution and especially pairs model approach. Thanks for sharing and looking forward towards your code release.",
      "votes": 4,
      "replies": [
        {
          "id": 1418004,
          "postDate": "2021-08-03T00:57:58.577Z",
          "content": "<p>Thank <a href=\"https://www.kaggle.com/rhtsingh\" target=\"_blank\">@rhtsingh</a> for all the amazing kernels in this competition. It helped me as well. </p>",
          "rawMarkdown": "Thank @rhtsingh for all the amazing kernels in this competition. It helped me as well. ",
          "votes": 2
        }
      ]
    },
    {
      "id": 1417952,
      "postDate": "2021-08-03T00:54:29.533Z",
      "content": "<p>Great work! How did you manage to train five large architectures with cross-validation in under three hours? </p>",
      "rawMarkdown": "Great work! How did you manage to train five large architectures with cross-validation in under three hours? ",
      "votes": 1,
      "replies": [
        {
          "id": 1418038,
          "postDate": "2021-08-03T01:00:03.333Z",
          "content": "<p>You dont really need to train the models in the Kaggle kernels. All solutions use the trained models and load the weights to do inference. We didnt find the 3 hr limit restrictive for this competition at all. You could get a lot of models running inference in that time w/ GPU. </p>",
          "rawMarkdown": "You dont really need to train the models in the Kaggle kernels. All solutions use the trained models and load the weights to do inference. We didnt find the 3 hr limit restrictive for this competition at all. You could get a lot of models running inference in that time w/ GPU. ",
          "votes": 2
        },
        {
          "id": 1418312,
          "postDate": "2021-08-03T01:17:25.667Z",
          "content": "<p>I see, thanks!  Because the rules only allowed external data if it was publicly available, I thought that excluded uploading our own private models as a Kaggle dataset. A naive first-timer mistake I guess!  To me, it seems that this defeats the purpose of a code competition a bit.  Congratulations on your great result! </p>",
          "rawMarkdown": "I see, thanks!  Because the rules only allowed external data if it was publicly available, I thought that excluded uploading our own private models as a Kaggle dataset. A naive first-timer mistake I guess!  To me, it seems that this defeats the purpose of a code competition a bit.  Congratulations on your great result! ",
          "votes": 1
        },
        {
          "id": 1418565,
          "postDate": "2021-08-03T01:33:23.327Z",
          "content": "<p>Ah ok. The external dataset refers to augmenting the training dataset with more training samples using external data. Almost all notebook competitions allow for loading a trained model to infer.</p>",
          "rawMarkdown": "Ah ok. The external dataset refers to augmenting the training dataset with more training samples using external data. Almost all notebook competitions allow for loading a trained model to infer.",
          "votes": 1
        }
      ]
    },
    {
      "id": 1466074,
      "postDate": "2021-08-11T09:56:39.760Z",
      "content": "<p>congratulations and thanks for sharing what worked and also most importantly what not worked <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> </p>",
      "rawMarkdown": "congratulations and thanks for sharing what worked and also most importantly what not worked @trushk ",
      "votes": 2
    },
    {
      "id": 1440571,
      "postDate": "2021-08-03T18:31:09.280Z",
      "content": "<p>Thanks for sharing, and congrats on coming on 20th place, even it is a very big achievement, and motivates beginners like us 🙂</p>",
      "rawMarkdown": "Thanks for sharing, and congrats on coming on 20th place, even it is a very big achievement, and motivates beginners like us 🙂",
      "votes": 2
    },
    {
      "id": 1419976,
      "postDate": "2021-08-03T02:53:14.843Z",
      "content": "<p>congratulations🎉🎉</p>",
      "rawMarkdown": "congratulations🎉🎉",
      "votes": 2
    },
    {
      "id": 1419950,
      "postDate": "2021-08-03T02:52:09.227Z",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> congrats on your winning and thanks for sharing your approach. I have some question </p>\n<ol>\n<li>which GPU you have used?</li>\n<li>can you share some intuition for custom head? </li>\n<li>Will you share scripts of pretaining and fine-tuning?</li>\n</ol>",
      "rawMarkdown": "Hi, @trushk congrats on your winning and thanks for sharing your approach. I have some question \n1. which GPU you have used?\n2. can you share some intuition for custom head? \n3. Will you share scripts of pretaining and fine-tuning?",
      "votes": 2,
      "replies": [
        {
          "id": 1440442,
          "postDate": "2021-08-03T18:19:01.917Z",
          "content": "<blockquote>\n  <p>which GPU you have used?</p>\n</blockquote>\n<p>2 x RTX 2080</p>\n<blockquote>\n  <p>can you share some intuition for custom head?</p>\n</blockquote>\n<p>We tried different heads including single FC layer but this arch seemed to work better along with GELU activation. Dropout was added to prevent overfitting considering the small dataset size</p>\n<blockquote>\n  <p>Will you share scripts of pretaining and fine-tuning?</p>\n</blockquote>\n<p>Code is here <a href=\"https://github.com/mv-lab/commonlit-readability-nlp\" target=\"_blank\">https://github.com/mv-lab/commonlit-readability-nlp</a></p>",
          "rawMarkdown": "> which GPU you have used?\n\n2 x RTX 2080\n\n> can you share some intuition for custom head?\n\nWe tried different heads including single FC layer but this arch seemed to work better along with GELU activation. Dropout was added to prevent overfitting considering the small dataset size\n\n> Will you share scripts of pretaining and fine-tuning?\n\nCode is here https://github.com/mv-lab/commonlit-readability-nlp",
          "votes": 2
        }
      ]
    },
    {
      "id": 1419192,
      "postDate": "2021-08-03T02:09:51.470Z",
      "content": "<p>Wow, you got an amazing score with Electra-large. I also tried it, actually I spent a considerable amount of time on it, but could not make it work. My best electra-large never went down the 0.500 public LB score. Congrats!</p>",
      "rawMarkdown": "Wow, you got an amazing score with Electra-large. I also tried it, actually I spent a considerable amount of time on it, but could not make it work. My best electra-large never went down the 0.500 public LB score. Congrats!",
      "votes": 2,
      "replies": [
        {
          "id": 1419628,
          "postDate": "2021-08-03T02:33:14.183Z",
          "content": "<p><a href=\"https://www.kaggle.com/hinepo/clrp-electra-inference-lb-0-504\" target=\"_blank\">This</a> was my best electra. Public: 0.504 ; Private: 0.500.</p>",
          "rawMarkdown": "[This](https://www.kaggle.com/hinepo/clrp-electra-inference-lb-0-504) was my best electra. Public: 0.504 ; Private: 0.500.",
          "votes": 1
        }
      ]
    },
    {
      "id": 1418440,
      "postDate": "2021-08-03T01:25:35.513Z",
      "content": "<p>I tried classifier(model(x1).logits[:,0,:]-model(x2).logits[:,0,:]) to predict is the first sentence has higher score, it did perform a lot better than regression approach, but I never got any result south of .46  (I admit we didn't try many backbone, only cyclical lr+discriminative lr for layers etc). Please elaborate on pair approach😃</p>",
      "rawMarkdown": "I tried classifier(model(x1).logits[:,0,:]-model(x2).logits[:,0,:]) to predict is the first sentence has higher score, it did perform a lot better than regression approach, but I never got any result south of .46  (I admit we didn't try many backbone, only cyclical lr+discriminative lr for layers etc). Please elaborate on pair approach😃",
      "votes": 2
    },
    {
      "id": 1418277,
      "postDate": "2021-08-03T01:15:02.270Z",
      "content": "<blockquote>\n  <p>Some Architectures like XLNET, ALBERT, T5, never converged.</p>\n</blockquote>\n<p>I do indeed agree with that. I experienced as well. Somehow they didn't converge🤣🤣</p>",
      "rawMarkdown": "> Some Architectures like XLNET, ALBERT, T5, never converged.\n\nI do indeed agree with that. I experienced as well. Somehow they didn't converge🤣🤣",
      "votes": 2
    },
    {
      "id": 1418127,
      "postDate": "2021-08-03T01:05:48.770Z",
      "content": "<p>Congrats team, thanks for sharing your approach </p>",
      "rawMarkdown": "Congrats team, thanks for sharing your approach \n",
      "votes": 2
    },
    {
      "id": 1418043,
      "postDate": "2021-08-03T01:00:11.627Z",
      "content": "<p>Congrats <a href=\"https://www.kaggle.com/trushk\" target=\"_blank\">@trushk</a> and team on 20th place </p>",
      "rawMarkdown": "Congrats @trushk and team on 20th place ",
      "votes": 2,
      "replies": [
        {
          "id": 1418272,
          "postDate": "2021-08-03T01:14:37.193Z",
          "content": "<p>Congrats  on 19th place !</p>",
          "rawMarkdown": "Congrats  on 19th place !",
          "votes": 1
        }
      ]
    },
    {
      "id": 1417814,
      "postDate": "2021-08-03T00:43:12.107Z",
      "content": "<p>Congrats nice results! Can you elaborate on your \"Pairs Model Approach\" a little bit more?</p>",
      "rawMarkdown": "Congrats nice results! Can you elaborate on your \"Pairs Model Approach\" a little bit more?",
      "votes": 2,
      "replies": [
        {
          "id": 1417842,
          "postDate": "2021-08-03T00:46:06.057Z",
          "content": "<p>Yes, writeup coming soon. Will post the link here. </p>",
          "rawMarkdown": "Yes, writeup coming soon. Will post the link here. ",
          "votes": 1
        },
        {
          "id": 1418527,
          "postDate": "2021-08-03T01:31:08.847Z",
          "content": "<p><a href=\"https://www.kaggle.com/datafan07\" target=\"_blank\">@datafan07</a> pairs approach is here: <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360</a> </p>",
          "rawMarkdown": "@datafan07 pairs approach is here: https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360 ",
          "votes": 1
        }
      ]
    },
    {
      "id": 1417780,
      "postDate": "2021-08-03T00:41:52.697Z",
      "content": "<p>Congratulations and thanks for sharing!<br>\nI'm kind of curious about the second approach. 0.454 on private is quite solid.<br>\nIs it ok to sharing some of its ideas? Thanks in advance :)</p>",
      "rawMarkdown": "Congratulations and thanks for sharing!\nI'm kind of curious about the second approach. 0.454 on private is quite solid.\nIs it ok to sharing some of its ideas? Thanks in advance :)",
      "votes": 2,
      "replies": [
        {
          "id": 1417844,
          "postDate": "2021-08-03T00:46:15.737Z",
          "content": "<p>Yes, writeup coming soon. Will post the link here.</p>",
          "rawMarkdown": "Yes, writeup coming soon. Will post the link here.\n\n",
          "votes": 2
        },
        {
          "id": 1418536,
          "postDate": "2021-08-03T01:31:34.183Z",
          "content": "<p><a href=\"https://www.kaggle.com/darrentitor\" target=\"_blank\">@darrentitor</a> pairs approach is here: <a href=\"https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360\" target=\"_blank\">https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360</a> </p>",
          "rawMarkdown": "@darrentitor pairs approach is here: https://www.kaggle.com/c/commonlitreadabilityprize/discussion/257360 ",
          "votes": 1
        }
      ]
    },
    {
      "id": 1417691,
      "postDate": "2021-08-03T00:34:45.300Z",
      "content": "<p>Congrats on the great result, and thanks for sharing!</p>",
      "rawMarkdown": "Congrats on the great result, and thanks for sharing!",
      "votes": 2
    },
    {
      "id": 1437076,
      "postDate": "2021-08-03T15:26:54.803Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1422501,
      "postDate": "2021-08-03T04:57:37.210Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true
    },
    {
      "id": 1417833,
      "postDate": "2021-08-03T00:45:07.267Z",
      "content": "<p>Congrats and thanks for sharing.</p>",
      "rawMarkdown": "Congrats and thanks for sharing.",
      "votes": 3
    },
    {
      "id": 1445299,
      "postDate": "2021-08-04T08:23:17.700Z",
      "content": "<p>Congrats, thanks for this sharing</p>",
      "rawMarkdown": "Congrats, thanks for this sharing",
      "votes": 1
    },
    {
      "id": 1425369,
      "postDate": "2021-08-03T06:47:03.077Z",
      "content": "<p>Thank you for sharing .</p>",
      "rawMarkdown": "Thank you for sharing .",
      "votes": 2
    },
    {
      "id": 1424498,
      "postDate": "2021-08-03T06:15:43.640Z",
      "content": "<p>congrats! Thank you for sharing.</p>",
      "rawMarkdown": "congrats! Thank you for sharing.\n\n",
      "votes": 2
    },
    {
      "id": 1419009,
      "postDate": "2021-08-03T02:01:00.003Z",
      "content": "<p>Congrats team and thanks for sharing!</p>",
      "rawMarkdown": "Congrats team and thanks for sharing!",
      "votes": 2
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T23:43:51Z",
  "competition_id": 25914,
  "competition_slug": "commonlitreadabilityprize",
  "team_id": 6989698,
  "solution_url": "/competitions/commonlitreadabilityprize/writeups/force-awakens-20th-place-solution"
}