{
  "id": 370118,
  "title": "Efficiency 17th Place Solution ",
  "content": "<h1>Overview</h1>\n<p>We are a group of three students representing <a href=\"https://penndsg.com/\" target=\"_blank\">Penn Data Science Group</a>. We had a lot of fun working on this competition and thank the Competition Host and Kaggle for hosting. </p>\n<p>Here goes our Efficiency Solution. </p>\n<p>We pseudolabeled the 15K essays from FB1 and FB2 using our own ensemble and then finetuned deberta-v3-xsmall for Efficiency.<br>\nThe ensemble has two components:</p>\n<ol>\n<li><strong>Pretrained Embeddings:</strong> We concatenated the mean-pooled hidden states from different debertas and different layers therein and trained MLPs and KernelRidge.<ul>\n<li>The hidden states add to over 20K in dimensions; interestingly, standardization / min-max scaling (which seems imperative to SVM etc.) leads to significantly worse result. This may be due to the layer normalization.</li>\n<li>KernelRidge uses <code>rbf</code> as kernel, with default <code>gamma</code>, and with <code>alpha</code> set to 0.075.</li>\n<li>MLP is structurally as follows:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5048151%2Ff17f5d18d746d22eff9e065799ed1823%2FWeChat%20Image_20221203000831.png?generation=1670044122478406&amp;alt=media\" alt=\"\"></li>\n<li>We used <a href=\"https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer\" target=\"_blank\">Ranger</a> as optimizer for the MLP. Per recommended, <code>beta_1</code> is set to 0.95, and the learning schedule is flat for the first 60-75% and then on a cosine decay for the remaining epochs. We set the flat rate as <code>3e-4</code> for the first 10 epochs, and then used cosine decay for the final 6 epochs, finishing on a learning rate of <code>9e-7</code> (in  other words, <code>alpha</code> is set to <code>3e-3</code>). The batch size is 64, and we used a weight decay of <code>1e-1</code>.</li>\n<li>To stablize results, we trained 50 iterations and took the mean prediction.</li></ul></li>\n<li><strong>Finetuned Models:</strong> We kinda sucked at finetuning models, so we took <a href=\"https://www.kaggle.com/kojimar\" target=\"_blank\">kojimar</a>'s models. Specifically, we took <a href=\"https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge-mnli\" target=\"_blank\">deberta-v2-xlarge-mnli</a>, <a href=\"https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge\" target=\"_blank\">deberta-v2-xlarge</a>, <a href=\"https://www.kaggle.com/datasets/kojimar/0926-deberta-v3-large-unscale\" target=\"_blank\">deberta-v3-large-unscale</a>, and <a href=\"https://www.kaggle.com/datasets/kojimar/20221012-123357-deberta-v3-large\" target=\"_blank\">20221012-deberta-v3-large</a>.</li>\n</ol>\n<p>This ensemble gave us an unimpressive 594th place on the private LB w/ 0.436685 and 1061th place on the public LB w/ 0.439137.</p>\n<p>The deberta-v3-xsmall is finetuned with the 4K essays from this competition with their true labels and the 15K essays from the previous two competitions with the pseudolabels.</p>\n<p>This model gave us 17th place on the Efficiency Private LB w/ 0.442 in 1336 seconds.</p>\n<h1>What Worked for Ensemble</h1>\n<p><strong>MLP &amp; Kernel Ridge for Pretrained Embeddings</strong></p>\n<ul>\n<li>Result: 0.446 CV as opposed to 0.451 CV for SVM.</li>\n<li>These two methods allow for a nonlinear specification whilst maintaining, if trained properly, robustness. </li>\n<li>SVM seems to be worse because of differences in objective and penalty (in direct comparison with Kernel Ridge). Actually, Bayesian Ridge with its linear specification can consistently beat SVM.</li>\n</ul>\n<p><strong>mish and Ranger on MLP</strong></p>\n<ul>\n<li>Result: 0.447 CV as opposed to 0.449 with swish and Ranger.</li>\n</ul>\n<p><strong>Including <em>Some</em> Finetuned Models</strong></p>\n<ul>\n<li>Results: 0.445 CV.</li>\n</ul>\n<h1>What Worked for Efficiency</h1>\n<p><strong>Psuedolabelling</strong></p>\n<ul>\n<li>Result: The xsmall model can closely trace the CV performance of the ensemble (I don't have the data here because we could not cross-validate the entire ensemble, but just take my words that an xsmall trained with only the 4K essays do worse).</li>\n<li>Knowledge distillation.</li>\n</ul>\n<p><strong>deberta-v3-xsmall</strong></p>\n<ul>\n<li>deberta-v3-xsmall performs better than deberta-v3-small, because it has 12 layers with hidden dimension as 384 as opposed to 6 layers with 768. The training/inference time is about the same, despite the increased layer counts.</li>\n<li>Interestingly, a base model I late-submitted performed much worse at 0.44674 private LB.</li>\n</ul>\n<p>Edit: <strong>Weight decay on weights</strong></p>\n<ul>\n<li>Place no weight decay on the bias and normalization terms; useful for both finetuning and the training of the MLP.</li>\n</ul>\n<h1>What Did Not Work</h1>\n<ul>\n<li>Translation for data augmentation.</li>\n<li>Finetuning techniques (Multi Sample Dropout, Layer Weight Reinitialization, Layerwise Learning Rate Adaptation). <ul>\n<li>I cannot quantify their improvements, and it seems that the increased sample size due to pseudolabelling offsets some benefits from these techniques.</li>\n<li>I submitted a version without MSD on the last date (but forgot to select it 😫); that had a private LB of 0.44 with probably a lower runtime (I didn't bother to prune the dropout, so the model technically stills feeds forward the last layer 8 times before taking an average); then again, I also changed some hyperparameters (lowering weight decay from 1e-1 to 1e-2 and increasing <code>beta_1</code> from 0.9 to 0.95).</li></ul></li>\n</ul>\n<h1>What we should have done</h1>\n<ul>\n<li>Use PyTorch? It inferences faster and without the pain of memory leakage. This would also allow for the usage efficienct data pipelines from huggingface. I suspect sub-1000s would need this and some more.</li>\n</ul>\n<h1>Important Citations</h1>\n<ul>\n<li><a href=\"https://www.kaggle.com/kojimar\" target=\"_blank\">kojimar</a>: Excellently finetuned models; we probably should have taken more models from you.</li>\n<li><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">Chris Deotte</a>: As far as I can tell, the first person to share using pretrained embeddings.</li>\n<li><a href=\"https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer\" target=\"_blank\">Ranger</a>: Robust and reliable optimizer.</li>\n</ul>\n<h1>Thanks and Acknowledgement</h1>\n<p>We thank the Competition Host and Kaggle for hosting and all those whom we cited for their insights.</p>\n<h1>Team Members</h1>\n<ul>\n<li><a href=\"https://www.kaggle.com/randyli2\" target=\"_blank\">Randy Li</a></li>\n<li><a href=\"https://www.kaggle.com/mangarahutagalung\" target=\"_blank\">Mangara Paul Alexander Hutagalung</a></li>\n<li><a href=\"https://www.kaggle.com/msgchris\" target=\"_blank\">Chris Sebastian</a></li>\n</ul>",
  "comments": [],
  "comment_count": 0,
  "messages": [
    {
      "id": 2053349,
      "postDate": "2022-12-03T06:26:57.173Z",
      "content": "<h1>Overview</h1>\n<p>We are a group of three students representing <a href=\"https://penndsg.com/\" target=\"_blank\">Penn Data Science Group</a>. We had a lot of fun working on this competition and thank the Competition Host and Kaggle for hosting. </p>\n<p>Here goes our Efficiency Solution. </p>\n<p>We pseudolabeled the 15K essays from FB1 and FB2 using our own ensemble and then finetuned deberta-v3-xsmall for Efficiency.<br>\nThe ensemble has two components:</p>\n<ol>\n<li><strong>Pretrained Embeddings:</strong> We concatenated the mean-pooled hidden states from different debertas and different layers therein and trained MLPs and KernelRidge.<ul>\n<li>The hidden states add to over 20K in dimensions; interestingly, standardization / min-max scaling (which seems imperative to SVM etc.) leads to significantly worse result. This may be due to the layer normalization.</li>\n<li>KernelRidge uses <code>rbf</code> as kernel, with default <code>gamma</code>, and with <code>alpha</code> set to 0.075.</li>\n<li>MLP is structurally as follows:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5048151%2Ff17f5d18d746d22eff9e065799ed1823%2FWeChat%20Image_20221203000831.png?generation=1670044122478406&amp;alt=media\" alt=\"\"></li>\n<li>We used <a href=\"https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer\" target=\"_blank\">Ranger</a> as optimizer for the MLP. Per recommended, <code>beta_1</code> is set to 0.95, and the learning schedule is flat for the first 60-75% and then on a cosine decay for the remaining epochs. We set the flat rate as <code>3e-4</code> for the first 10 epochs, and then used cosine decay for the final 6 epochs, finishing on a learning rate of <code>9e-7</code> (in  other words, <code>alpha</code> is set to <code>3e-3</code>). The batch size is 64, and we used a weight decay of <code>1e-1</code>.</li>\n<li>To stablize results, we trained 50 iterations and took the mean prediction.</li></ul></li>\n<li><strong>Finetuned Models:</strong> We kinda sucked at finetuning models, so we took <a href=\"https://www.kaggle.com/kojimar\" target=\"_blank\">kojimar</a>'s models. Specifically, we took <a href=\"https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge-mnli\" target=\"_blank\">deberta-v2-xlarge-mnli</a>, <a href=\"https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge\" target=\"_blank\">deberta-v2-xlarge</a>, <a href=\"https://www.kaggle.com/datasets/kojimar/0926-deberta-v3-large-unscale\" target=\"_blank\">deberta-v3-large-unscale</a>, and <a href=\"https://www.kaggle.com/datasets/kojimar/20221012-123357-deberta-v3-large\" target=\"_blank\">20221012-deberta-v3-large</a>.</li>\n</ol>\n<p>This ensemble gave us an unimpressive 594th place on the private LB w/ 0.436685 and 1061th place on the public LB w/ 0.439137.</p>\n<p>The deberta-v3-xsmall is finetuned with the 4K essays from this competition with their true labels and the 15K essays from the previous two competitions with the pseudolabels.</p>\n<p>This model gave us 17th place on the Efficiency Private LB w/ 0.442 in 1336 seconds.</p>\n<h1>What Worked for Ensemble</h1>\n<p><strong>MLP &amp; Kernel Ridge for Pretrained Embeddings</strong></p>\n<ul>\n<li>Result: 0.446 CV as opposed to 0.451 CV for SVM.</li>\n<li>These two methods allow for a nonlinear specification whilst maintaining, if trained properly, robustness. </li>\n<li>SVM seems to be worse because of differences in objective and penalty (in direct comparison with Kernel Ridge). Actually, Bayesian Ridge with its linear specification can consistently beat SVM.</li>\n</ul>\n<p><strong>mish and Ranger on MLP</strong></p>\n<ul>\n<li>Result: 0.447 CV as opposed to 0.449 with swish and Ranger.</li>\n</ul>\n<p><strong>Including <em>Some</em> Finetuned Models</strong></p>\n<ul>\n<li>Results: 0.445 CV.</li>\n</ul>\n<h1>What Worked for Efficiency</h1>\n<p><strong>Psuedolabelling</strong></p>\n<ul>\n<li>Result: The xsmall model can closely trace the CV performance of the ensemble (I don't have the data here because we could not cross-validate the entire ensemble, but just take my words that an xsmall trained with only the 4K essays do worse).</li>\n<li>Knowledge distillation.</li>\n</ul>\n<p><strong>deberta-v3-xsmall</strong></p>\n<ul>\n<li>deberta-v3-xsmall performs better than deberta-v3-small, because it has 12 layers with hidden dimension as 384 as opposed to 6 layers with 768. The training/inference time is about the same, despite the increased layer counts.</li>\n<li>Interestingly, a base model I late-submitted performed much worse at 0.44674 private LB.</li>\n</ul>\n<p>Edit: <strong>Weight decay on weights</strong></p>\n<ul>\n<li>Place no weight decay on the bias and normalization terms; useful for both finetuning and the training of the MLP.</li>\n</ul>\n<h1>What Did Not Work</h1>\n<ul>\n<li>Translation for data augmentation.</li>\n<li>Finetuning techniques (Multi Sample Dropout, Layer Weight Reinitialization, Layerwise Learning Rate Adaptation). <ul>\n<li>I cannot quantify their improvements, and it seems that the increased sample size due to pseudolabelling offsets some benefits from these techniques.</li>\n<li>I submitted a version without MSD on the last date (but forgot to select it 😫); that had a private LB of 0.44 with probably a lower runtime (I didn't bother to prune the dropout, so the model technically stills feeds forward the last layer 8 times before taking an average); then again, I also changed some hyperparameters (lowering weight decay from 1e-1 to 1e-2 and increasing <code>beta_1</code> from 0.9 to 0.95).</li></ul></li>\n</ul>\n<h1>What we should have done</h1>\n<ul>\n<li>Use PyTorch? It inferences faster and without the pain of memory leakage. This would also allow for the usage efficienct data pipelines from huggingface. I suspect sub-1000s would need this and some more.</li>\n</ul>\n<h1>Important Citations</h1>\n<ul>\n<li><a href=\"https://www.kaggle.com/kojimar\" target=\"_blank\">kojimar</a>: Excellently finetuned models; we probably should have taken more models from you.</li>\n<li><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">Chris Deotte</a>: As far as I can tell, the first person to share using pretrained embeddings.</li>\n<li><a href=\"https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer\" target=\"_blank\">Ranger</a>: Robust and reliable optimizer.</li>\n</ul>\n<h1>Thanks and Acknowledgement</h1>\n<p>We thank the Competition Host and Kaggle for hosting and all those whom we cited for their insights.</p>\n<h1>Team Members</h1>\n<ul>\n<li><a href=\"https://www.kaggle.com/randyli2\" target=\"_blank\">Randy Li</a></li>\n<li><a href=\"https://www.kaggle.com/mangarahutagalung\" target=\"_blank\">Mangara Paul Alexander Hutagalung</a></li>\n<li><a href=\"https://www.kaggle.com/msgchris\" target=\"_blank\">Chris Sebastian</a></li>\n</ul>",
      "rawMarkdown": "# Overview\nWe are a group of three students representing [Penn Data Science Group](https://penndsg.com/). We had a lot of fun working on this competition and thank the Competition Host and Kaggle for hosting. \n\nHere goes our Efficiency Solution. \n\nWe pseudolabeled the 15K essays from FB1 and FB2 using our own ensemble and then finetuned deberta-v3-xsmall for Efficiency.\nThe ensemble has two components:\n1. **Pretrained Embeddings:** We concatenated the mean-pooled hidden states from different debertas and different layers therein and trained MLPs and KernelRidge.\n  - The hidden states add to over 20K in dimensions; interestingly, standardization / min-max scaling (which seems imperative to SVM etc.) leads to significantly worse result. This may be due to the layer normalization.\n  - KernelRidge uses `rbf` as kernel, with default `gamma`, and with `alpha` set to 0.075.\n  - MLP is structurally as follows:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5048151%2Ff17f5d18d746d22eff9e065799ed1823%2FWeChat%20Image_20221203000831.png?generation=1670044122478406&alt=media)\n  - We used [Ranger](https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer) as optimizer for the MLP. Per recommended, `beta_1` is set to 0.95, and the learning schedule is flat for the first 60-75% and then on a cosine decay for the remaining epochs. We set the flat rate as `3e-4` for the first 10 epochs, and then used cosine decay for the final 6 epochs, finishing on a learning rate of `9e-7` (in  other words, `alpha` is set to `3e-3`). The batch size is 64, and we used a weight decay of `1e-1`.\n  - To stablize results, we trained 50 iterations and took the mean prediction.\n2. **Finetuned Models:** We kinda sucked at finetuning models, so we took [kojimar](https://www.kaggle.com/kojimar)'s models. Specifically, we took [deberta-v2-xlarge-mnli](https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge-mnli), [deberta-v2-xlarge](https://www.kaggle.com/datasets/kojimar/0919-deberta-v2-xlarge), [deberta-v3-large-unscale](https://www.kaggle.com/datasets/kojimar/0926-deberta-v3-large-unscale), and [20221012-deberta-v3-large](https://www.kaggle.com/datasets/kojimar/20221012-123357-deberta-v3-large).\n\nThis ensemble gave us an unimpressive 594th place on the private LB w/ 0.436685 and 1061th place on the public LB w/ 0.439137.\n\nThe deberta-v3-xsmall is finetuned with the 4K essays from this competition with their true labels and the 15K essays from the previous two competitions with the pseudolabels.\n\nThis model gave us 17th place on the Efficiency Private LB w/ 0.442 in 1336 seconds.\n\n# What Worked for Ensemble\n**MLP & Kernel Ridge for Pretrained Embeddings**\n- Result: 0.446 CV as opposed to 0.451 CV for SVM.\n- These two methods allow for a nonlinear specification whilst maintaining, if trained properly, robustness. \n- SVM seems to be worse because of differences in objective and penalty (in direct comparison with Kernel Ridge). Actually, Bayesian Ridge with its linear specification can consistently beat SVM.\n\n**mish and Ranger on MLP**\n- Result: 0.447 CV as opposed to 0.449 with swish and Ranger.\n\n**Including *Some* Finetuned Models**\n- Results: 0.445 CV.\n\n# What Worked for Efficiency\n**Psuedolabelling**\n- Result: The xsmall model can closely trace the CV performance of the ensemble (I don't have the data here because we could not cross-validate the entire ensemble, but just take my words that an xsmall trained with only the 4K essays do worse).\n- Knowledge distillation.\n\n**deberta-v3-xsmall**\n- deberta-v3-xsmall performs better than deberta-v3-small, because it has 12 layers with hidden dimension as 384 as opposed to 6 layers with 768. The training/inference time is about the same, despite the increased layer counts.\n- Interestingly, a base model I late-submitted performed much worse at 0.44674 private LB.\n\nEdit: **Weight decay on weights**\n- Place no weight decay on the bias and normalization terms; useful for both finetuning and the training of the MLP.\n\n# What Did Not Work\n- Translation for data augmentation.\n- Finetuning techniques (Multi Sample Dropout, Layer Weight Reinitialization, Layerwise Learning Rate Adaptation). \n  - I cannot quantify their improvements, and it seems that the increased sample size due to pseudolabelling offsets some benefits from these techniques.\n  - I submitted a version without MSD on the last date (but forgot to select it 😫); that had a private LB of 0.44 with probably a lower runtime (I didn't bother to prune the dropout, so the model technically stills feeds forward the last layer 8 times before taking an average); then again, I also changed some hyperparameters (lowering weight decay from 1e-1 to 1e-2 and increasing `beta_1` from 0.9 to 0.95).\n\n# What we should have done\n- Use PyTorch? It inferences faster and without the pain of memory leakage. This would also allow for the usage efficienct data pipelines from huggingface. I suspect sub-1000s would need this and some more.\n\n# Important Citations\n- [kojimar](https://www.kaggle.com/kojimar): Excellently finetuned models; we probably should have taken more models from you.\n- [Chris Deotte](https://www.kaggle.com/cdeotte): As far as I can tell, the first person to share using pretrained embeddings.\n- [Ranger](https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer): Robust and reliable optimizer.\n\n# Thanks and Acknowledgement\nWe thank the Competition Host and Kaggle for hosting and all those whom we cited for their insights.\n\n# Team Members\n- [Randy Li](https://www.kaggle.com/randyli2)\n- [Mangara Paul Alexander Hutagalung](https://www.kaggle.com/mangarahutagalung)\n- [Chris Sebastian](https://www.kaggle.com/msgchris)",
      "votes": 6
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T20:05:03Z",
  "competition_id": 38321,
  "competition_slug": "feedback-prize-english-language-learning",
  "team_id": 9131827,
  "solution_url": "/competitions/feedback-prize-english-language-learning/writeups/pdsg-efficiency-17th-place-solution"
}