{
  "id": 287914,
  "title": "17th place solution - BigBird 🐥",
  "content": "<p>First of all, a huge thank you to the competition hosts and Kaggle. I spent an absurd amount of time on this competition, and I’ve definitely learned a lot about QA, multilingual models, and Kaggle in general.</p>\n<p>This was basically the first time I put myself out into the public section of Kaggle, and I’m so happy for the following achievements since the start of this competition:</p>\n<ul>\n<li>3x Kaggle Expert (Datasets, Notebooks, and Discussions), soon to be 4x 😊</li>\n<li>2x Gold notebooks</li>\n<li>20+ gold/silver comments</li>\n<li>Going from 600+ on the LB a few days ago to ending at 17th today (the turtle after my username was initially set to represent my progress. Slow and steady!)</li>\n<li>A new job 🤗</li>\n</ul>\n<h2>My solution</h2>\n<h4>XLM-R</h4>\n<ul>\n<li>6 folds, 384 max length, 128 stride, private/public LB 0.747/0.77, CV avg 0.718</li>\n</ul>\n<h4>MuRIL Large</h4>\n<ul>\n<li>6 folds, 384 max length, 128 stride, private/public LB 0.739/0.777, CV avg (forgot)</li>\n</ul>\n<h4>RemBERT</h4>\n<ul>\n<li>5 folds, 384 max length, 128 stride, private/public LB 0.750/0.786, CV avg 0.748</li>\n</ul>\n<h4>MuRIL Large BigBird</h4>\n<ul>\n<li>6 folds, 1024 max length, 512 stride, private/public LB 0.756/0.796, CV avg 0.732,</li>\n</ul>\n<p>The last model is probably the only novel thing I did, and also the reason I placed this high. I noticed that the contexts for these passages were pretty long, and from a bit of research I saw that BigBird and LongFormer were the two architectures designed for long contexts without having the compute time blow up.  I also noticed that the BigBird authors indicated that they did a “warm start” from a BERT checkpoint when training their model that reduced the number of training steps, so I figured I’d do the same from XLM-R or MuRIL (<a href=\"https://arxiv.org/pdf/2007.14062.pdf\" target=\"_blank\">see page 7 under section called Pretraining and MLM</a>). Since MuRIL is basically identical to BERT, all of the weights (except one module) loaded in to a BigBird model without trouble.  The thing that caught me up for a bit was the fact that the position embeddings (which are learned) were going from (512, 768) to (4096, 768)  (max_seq_length, hidden_size). I followed the Longformer authors and ended up tiling the original position embeddings 8 times to make it fit ([see page 6 under section Position Embeddings](Position Embeddings)).</p>\n<p>I trained for 150k steps on TPU v3-8 using Flax with a batch size of 1 using Masked Language Modeling as the training task. I used the Tamil, Hindi, Telugu, Urdu, and English sections of mc4 and stuck it straight into the model without cleaning. Doing whole-word masking and data cleaning would probably help significantly, but I didn’t have the time.  I did the same for the large size, but I could only fit a 1024 sequence length and I only trained for 90k steps at batch size 1. The base model got up to 75% accuracy and the large model got 71% on MLM in the eval set.</p>\n<p>From there, my MuRIL Large, XLM-R, and Muril Large BigBird models were trained first on SQuAD2 and then on XQuAD, MLQA, TyDiQA (telugu), and chaii datasets, validating only on a stratified chaii fold. Since I still had compute time, I did all of this easily and quickly on TPU v3-8 using Flax. <br>\nRemBERT was a pain to train on Kaggle GPUs, so I used Tensorflow and Kaggle TPUs. This made it easy, and I convinced myself that having some models in Tensorflow provided model diversity. I trained it on SQuAD2 and then TyDiQA, MLQA, XQuAD.</p>\n<p><a href=\"https://www.kaggle.com/nbroad/test-1k-6f\" target=\"_blank\">Here is the final notebook that got my highest score</a>. It is messy and wasn't meant to be my final submission 😅</p>\n<h3>Ensembling</h3>\n<p>I didn't actually get a submission out with an ensemble. My highest score without ensembling different models was 6 folds of MuRIL BigBird Large. I would never be able to get 23 folds to finish in time, but I was planning on splitting the passages based on length at around 10k characters. Under 10k go to XLMR, MuRIL Large, RemBERT, and MuRIL BigBird Large. Above 10k would just be MuRIL BigBird Large. Some of those contexts are so long especially when broken up with 384/128.</p>\n<p>For ensembling, I tried voting but ran out of time before getting something to work. I ultimately converted the token logits to character logits by averaging the overlap between multiple sections and concatenating them together. Once they are character logits, they can be averaged across all models without worrying about lining up models with different tokenizers. I got this working with a few hours left, and I made one small mistake in my submission, which made the notebooks exceed the submission time. It did seem like a promising way of combining models. <a href=\"https://www.kaggle.com/nbroad/final-sub-char-avg\" target=\"_blank\">Here is the notebook I didn't finish in time that has character-level averaging.</a> It's pretty messy because I was cramming stuff in earlier today to try to get it done.</p>\n<p>Much thanks to TRC for the compute time on v3-8 TPUs. All of my models are now available on my <a href=\"https://huggingface.co/nbroad\" target=\"_blank\">Hugging Face profile</a>.</p>\n<h3>What didn’t work</h3>\n<ul>\n<li>Attention heads on the end</li>\n<li>Conv. layers on the end</li>\n<li>Concatenating start logits to end logits</li>\n<li>Translating at test time and doing cross-lingual QA (English questions with Hindi/Tamil contexts)</li>\n<li>Monolingual models</li>\n<li>“QA Pretraining” on tons of other languages before finetuning: Arabic, Persian, Bengali, German, Thai, Korean. Only English, German, Hindi, Telugu, and Tamil helped. I think they were the highest quality, and most of the others were poor translations.</li>\n<li><a href=\"https://arxiv.org/abs/2101.00438\" target=\"_blank\">Splinter</a>/<a href=\"https://arxiv.org/pdf/2109.01951.pdf\" target=\"_blank\">FewShotQA</a> <ul>\n<li>I thought this would be perfect for this scenario because it excels at small datasets, but I could never get the model to converge</li>\n<li><a href=\"https://github.com/oriram/splinter\" target=\"_blank\">They even had starter code</a> but it was in Tensorflow 1 and I stubbornly tried to turn it into PyTorch.</li></ul></li>\n<li>NaturalQuestions/TriviaQA<ul>\n<li>NQ is just a pain to work with because it’s absurdly large and the formatting is weird. I don’t think I ever got the training data to actually look right which is why I gave up on using it.</li>\n<li>Ran out of time before trying TriviaQA.</li></ul></li>\n<li>Training a question-generating model to label more data<ul>\n<li>mt5 is huge and hard to train. I could only get a base model trained and it didn’t seem that good. <a href=\"https://arxiv.org/pdf/1906.05416.pdf\" target=\"_blank\">This article indicates</a> that using millions of pseudolabels works, but I didn’t think I’d have the capacity to get this going.</li></ul></li>\n</ul>",
  "comments": [
    {
      "id": 1584856,
      "author_name": "Darek Kłeczek",
      "author_url": "",
      "post_date": "2021-11-16T20:14:15.127000",
      "content": "<p>Congrats Nicholas! I'd replace that turtle with a kangaroo, your jump in the last days was impressive! Awesome execution with Longformer, I was thinking about it but gave up without trying. I vote you the MVP of this competition, thanks for all the sharing and discussions! And congrats on the new job!</p>",
      "votes": 3,
      "replies": [
        {
          "id": 1586036,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-17T18:41:13.013000",
          "content": "<p>Thanks for voting me MVP! I humbly accept the award 😄</p>\n<p>I tried hard this competition to learn as much as I could and share as much as possible while keeping a few tricks up my sleeve. Your early notebooks laid the foundation that many of us used throughout the competition.  Thank you for your hard work, and congratulations on the 1st place finish 🎉</p>\n<p>I'll change my emoji to a kangaroo now 😊</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1583729,
      "author_name": "KhanhVD",
      "author_url": "",
      "post_date": "2021-11-16T03:02:16.457000",
      "content": "<p>Congrats <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> on results, nice jump</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1589777,
      "author_name": "Parv Yadav",
      "author_url": "",
      "post_date": "2021-11-20T15:02:09.130000",
      "content": "<p>Well written <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !😊</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1587815,
      "author_name": "MINGOOK KIM",
      "author_url": "",
      "post_date": "2021-11-19T00:23:44.230000",
      "content": "<p>Thank you for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> and thank you for your post.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1586347,
      "author_name": "Ayush Singh",
      "author_url": "",
      "post_date": "2021-11-18T02:22:24.660000",
      "content": "<p>Very well written, nice approach .. well deserved <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> on your win. Congratulations. </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1585168,
      "author_name": "adldotori",
      "author_url": "",
      "post_date": "2021-11-17T06:12:25.080000",
      "content": "<p>Congrats. i'm envious of gold medal.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1586368,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-18T02:46:25.047000",
          "content": "<p>Me too! I only got a silver 😄</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1584499,
      "author_name": "Mathurin Ache",
      "author_url": "",
      "post_date": "2021-11-16T15:07:07.250000",
      "content": "<p>Well done <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> and thank you for your post.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1584273,
      "author_name": "Zacchaeus",
      "author_url": "",
      "post_date": "2021-11-16T12:05:50.233000",
      "content": "<p>Just went thru ur solution again. The BigBird \"warm start\" thing is really amazing. I tried longformer-base from MLMed scratch and it worked really bad. Also, TPU and tensorflow are really hard for me. Implementing the novel thing with TPU is even more amazing.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1584360,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-16T13:36:28.510000",
          "content": "<p>I also tried without doing a warm start and it was terrible 😄</p>\n<p>And I didn't use Tensorflow to train the BigBird model - I used Jax/Flax. <a href=\"https://github.com/huggingface/transformers/tree/master/examples/flax\" target=\"_blank\">Hugging Face has a couple of examples</a> that make it dead simple to get going. I'm sure there are more optimizations and details that I could have done, but I didn't have the time nor experience to learn them in time for this competition.</p>\n<p>Also, this would have been extremely expensive without using the TRC. I'm curious to see if Kaggle takes a stance on whether competitors can use TRC in the future</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1583672,
      "author_name": "DrHB",
      "author_url": "",
      "post_date": "2021-11-16T01:52:58.053000",
      "content": "<p>Great finish! Congratulations ! </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1583659,
      "author_name": "Kishal Mandal",
      "author_url": "",
      "post_date": "2021-11-16T01:39:38.853000",
      "content": "<p>1024!!!! blew my mind. Congratulations for that huge jump :)</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1583698,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-16T02:16:10.793000",
          "content": "<p>I wanted to run a 4k seq length model… but it was too big to train! </p>\n<p>Sometimes the shakeups work in your favor, sometimes they don't. They more experience you have, the less likely it will be to drop. Keep practicing!</p>\n<p>Thanks for all of the discussion and notebooks! See you in the next one!</p>\n<h1>👍</h1>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1583657,
      "author_name": "Luca Massaron",
      "author_url": "",
      "post_date": "2021-11-16T01:38:22.983000",
      "content": "<p>Good job for your first public competition! Compliments!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1583576,
      "author_name": "Zacchaeus",
      "author_url": "",
      "post_date": "2021-11-16T00:30:06.820000",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> for actively sharing during the competition. 👍</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1583640,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-16T01:22:13.123000",
          "content": "<p>Thanks for the discussions and posts! </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1583610,
      "author_name": "Chris Deotte",
      "author_url": "",
      "post_date": "2021-11-16T01:01:26.197000",
      "content": "<p>Congratulations. Fantastic solo finish! It appears that <code>RemBERT</code> and <code>MuRIL Large BigBird</code> did very well on private LB.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1583623,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2021-11-16T01:12:39.480000",
          "content": "<p>Thanks Chris! It means a lot to get praise from you 😊</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1693411,
      "author_name": "Tetiana Yakovlieva",
      "author_url": "",
      "post_date": "2022-02-16T16:53:59.253000",
      "content": "<p>Thank you for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 20,
  "messages": [
    {
      "id": 1583557,
      "postDate": "2021-11-16T00:10:10.560Z",
      "content": "<p>First of all, a huge thank you to the competition hosts and Kaggle. I spent an absurd amount of time on this competition, and I’ve definitely learned a lot about QA, multilingual models, and Kaggle in general.</p>\n<p>This was basically the first time I put myself out into the public section of Kaggle, and I’m so happy for the following achievements since the start of this competition:</p>\n<ul>\n<li>3x Kaggle Expert (Datasets, Notebooks, and Discussions), soon to be 4x 😊</li>\n<li>2x Gold notebooks</li>\n<li>20+ gold/silver comments</li>\n<li>Going from 600+ on the LB a few days ago to ending at 17th today (the turtle after my username was initially set to represent my progress. Slow and steady!)</li>\n<li>A new job 🤗</li>\n</ul>\n<h2>My solution</h2>\n<h4>XLM-R</h4>\n<ul>\n<li>6 folds, 384 max length, 128 stride, private/public LB 0.747/0.77, CV avg 0.718</li>\n</ul>\n<h4>MuRIL Large</h4>\n<ul>\n<li>6 folds, 384 max length, 128 stride, private/public LB 0.739/0.777, CV avg (forgot)</li>\n</ul>\n<h4>RemBERT</h4>\n<ul>\n<li>5 folds, 384 max length, 128 stride, private/public LB 0.750/0.786, CV avg 0.748</li>\n</ul>\n<h4>MuRIL Large BigBird</h4>\n<ul>\n<li>6 folds, 1024 max length, 512 stride, private/public LB 0.756/0.796, CV avg 0.732,</li>\n</ul>\n<p>The last model is probably the only novel thing I did, and also the reason I placed this high. I noticed that the contexts for these passages were pretty long, and from a bit of research I saw that BigBird and LongFormer were the two architectures designed for long contexts without having the compute time blow up.  I also noticed that the BigBird authors indicated that they did a “warm start” from a BERT checkpoint when training their model that reduced the number of training steps, so I figured I’d do the same from XLM-R or MuRIL (<a href=\"https://arxiv.org/pdf/2007.14062.pdf\" target=\"_blank\">see page 7 under section called Pretraining and MLM</a>). Since MuRIL is basically identical to BERT, all of the weights (except one module) loaded in to a BigBird model without trouble.  The thing that caught me up for a bit was the fact that the position embeddings (which are learned) were going from (512, 768) to (4096, 768)  (max_seq_length, hidden_size). I followed the Longformer authors and ended up tiling the original position embeddings 8 times to make it fit ([see page 6 under section Position Embeddings](Position Embeddings)).</p>\n<p>I trained for 150k steps on TPU v3-8 using Flax with a batch size of 1 using Masked Language Modeling as the training task. I used the Tamil, Hindi, Telugu, Urdu, and English sections of mc4 and stuck it straight into the model without cleaning. Doing whole-word masking and data cleaning would probably help significantly, but I didn’t have the time.  I did the same for the large size, but I could only fit a 1024 sequence length and I only trained for 90k steps at batch size 1. The base model got up to 75% accuracy and the large model got 71% on MLM in the eval set.</p>\n<p>From there, my MuRIL Large, XLM-R, and Muril Large BigBird models were trained first on SQuAD2 and then on XQuAD, MLQA, TyDiQA (telugu), and chaii datasets, validating only on a stratified chaii fold. Since I still had compute time, I did all of this easily and quickly on TPU v3-8 using Flax. <br>\nRemBERT was a pain to train on Kaggle GPUs, so I used Tensorflow and Kaggle TPUs. This made it easy, and I convinced myself that having some models in Tensorflow provided model diversity. I trained it on SQuAD2 and then TyDiQA, MLQA, XQuAD.</p>\n<p><a href=\"https://www.kaggle.com/nbroad/test-1k-6f\" target=\"_blank\">Here is the final notebook that got my highest score</a>. It is messy and wasn't meant to be my final submission 😅</p>\n<h3>Ensembling</h3>\n<p>I didn't actually get a submission out with an ensemble. My highest score without ensembling different models was 6 folds of MuRIL BigBird Large. I would never be able to get 23 folds to finish in time, but I was planning on splitting the passages based on length at around 10k characters. Under 10k go to XLMR, MuRIL Large, RemBERT, and MuRIL BigBird Large. Above 10k would just be MuRIL BigBird Large. Some of those contexts are so long especially when broken up with 384/128.</p>\n<p>For ensembling, I tried voting but ran out of time before getting something to work. I ultimately converted the token logits to character logits by averaging the overlap between multiple sections and concatenating them together. Once they are character logits, they can be averaged across all models without worrying about lining up models with different tokenizers. I got this working with a few hours left, and I made one small mistake in my submission, which made the notebooks exceed the submission time. It did seem like a promising way of combining models. <a href=\"https://www.kaggle.com/nbroad/final-sub-char-avg\" target=\"_blank\">Here is the notebook I didn't finish in time that has character-level averaging.</a> It's pretty messy because I was cramming stuff in earlier today to try to get it done.</p>\n<p>Much thanks to TRC for the compute time on v3-8 TPUs. All of my models are now available on my <a href=\"https://huggingface.co/nbroad\" target=\"_blank\">Hugging Face profile</a>.</p>\n<h3>What didn’t work</h3>\n<ul>\n<li>Attention heads on the end</li>\n<li>Conv. layers on the end</li>\n<li>Concatenating start logits to end logits</li>\n<li>Translating at test time and doing cross-lingual QA (English questions with Hindi/Tamil contexts)</li>\n<li>Monolingual models</li>\n<li>“QA Pretraining” on tons of other languages before finetuning: Arabic, Persian, Bengali, German, Thai, Korean. Only English, German, Hindi, Telugu, and Tamil helped. I think they were the highest quality, and most of the others were poor translations.</li>\n<li><a href=\"https://arxiv.org/abs/2101.00438\" target=\"_blank\">Splinter</a>/<a href=\"https://arxiv.org/pdf/2109.01951.pdf\" target=\"_blank\">FewShotQA</a> <ul>\n<li>I thought this would be perfect for this scenario because it excels at small datasets, but I could never get the model to converge</li>\n<li><a href=\"https://github.com/oriram/splinter\" target=\"_blank\">They even had starter code</a> but it was in Tensorflow 1 and I stubbornly tried to turn it into PyTorch.</li></ul></li>\n<li>NaturalQuestions/TriviaQA<ul>\n<li>NQ is just a pain to work with because it’s absurdly large and the formatting is weird. I don’t think I ever got the training data to actually look right which is why I gave up on using it.</li>\n<li>Ran out of time before trying TriviaQA.</li></ul></li>\n<li>Training a question-generating model to label more data<ul>\n<li>mt5 is huge and hard to train. I could only get a base model trained and it didn’t seem that good. <a href=\"https://arxiv.org/pdf/1906.05416.pdf\" target=\"_blank\">This article indicates</a> that using millions of pseudolabels works, but I didn’t think I’d have the capacity to get this going.</li></ul></li>\n</ul>",
      "rawMarkdown": "First of all, a huge thank you to the competition hosts and Kaggle. I spent an absurd amount of time on this competition, and I’ve definitely learned a lot about QA, multilingual models, and Kaggle in general.\n\nThis was basically the first time I put myself out into the public section of Kaggle, and I’m so happy for the following achievements since the start of this competition:\n\n- 3x Kaggle Expert (Datasets, Notebooks, and Discussions), soon to be 4x 😊\n- 2x Gold notebooks\n- 20+ gold/silver comments\n- Going from 600+ on the LB a few days ago to ending at 17th today (the turtle after my username was initially set to represent my progress. Slow and steady!)\n- A new job 🤗\n\n## My solution\n\n#### XLM-R\n- 6 folds, 384 max length, 128 stride, private/public LB 0.747/0.77, CV avg 0.718\n#### MuRIL Large\n- 6 folds, 384 max length, 128 stride, private/public LB 0.739/0.777, CV avg (forgot)\n#### RemBERT\n- 5 folds, 384 max length, 128 stride, private/public LB 0.750/0.786, CV avg 0.748\n#### MuRIL Large BigBird\n- 6 folds, 1024 max length, 512 stride, private/public LB 0.756/0.796, CV avg 0.732,\n\nThe last model is probably the only novel thing I did, and also the reason I placed this high. I noticed that the contexts for these passages were pretty long, and from a bit of research I saw that BigBird and LongFormer were the two architectures designed for long contexts without having the compute time blow up.  I also noticed that the BigBird authors indicated that they did a “warm start” from a BERT checkpoint when training their model that reduced the number of training steps, so I figured I’d do the same from XLM-R or MuRIL ([see page 7 under section called Pretraining and MLM](https://arxiv.org/pdf/2007.14062.pdf)). Since MuRIL is basically identical to BERT, all of the weights (except one module) loaded in to a BigBird model without trouble.  The thing that caught me up for a bit was the fact that the position embeddings (which are learned) were going from (512, 768) to (4096, 768)  (max_seq_length, hidden_size). I followed the Longformer authors and ended up tiling the original position embeddings 8 times to make it fit ([see page 6 under section Position Embeddings](Position Embeddings)).\n\nI trained for 150k steps on TPU v3-8 using Flax with a batch size of 1 using Masked Language Modeling as the training task. I used the Tamil, Hindi, Telugu, Urdu, and English sections of mc4 and stuck it straight into the model without cleaning. Doing whole-word masking and data cleaning would probably help significantly, but I didn’t have the time.  I did the same for the large size, but I could only fit a 1024 sequence length and I only trained for 90k steps at batch size 1. The base model got up to 75% accuracy and the large model got 71% on MLM in the eval set.\n\nFrom there, my MuRIL Large, XLM-R, and Muril Large BigBird models were trained first on SQuAD2 and then on XQuAD, MLQA, TyDiQA (telugu), and chaii datasets, validating only on a stratified chaii fold. Since I still had compute time, I did all of this easily and quickly on TPU v3-8 using Flax. \nRemBERT was a pain to train on Kaggle GPUs, so I used Tensorflow and Kaggle TPUs. This made it easy, and I convinced myself that having some models in Tensorflow provided model diversity. I trained it on SQuAD2 and then TyDiQA, MLQA, XQuAD.\n\n[Here is the final notebook that got my highest score](https://www.kaggle.com/nbroad/test-1k-6f). It is messy and wasn't meant to be my final submission 😅\n\n### Ensembling\nI didn't actually get a submission out with an ensemble. My highest score without ensembling different models was 6 folds of MuRIL BigBird Large. I would never be able to get 23 folds to finish in time, but I was planning on splitting the passages based on length at around 10k characters. Under 10k go to XLMR, MuRIL Large, RemBERT, and MuRIL BigBird Large. Above 10k would just be MuRIL BigBird Large. Some of those contexts are so long especially when broken up with 384/128.\n\nFor ensembling, I tried voting but ran out of time before getting something to work. I ultimately converted the token logits to character logits by averaging the overlap between multiple sections and concatenating them together. Once they are character logits, they can be averaged across all models without worrying about lining up models with different tokenizers. I got this working with a few hours left, and I made one small mistake in my submission, which made the notebooks exceed the submission time. It did seem like a promising way of combining models. [Here is the notebook I didn't finish in time that has character-level averaging.](https://www.kaggle.com/nbroad/final-sub-char-avg) It's pretty messy because I was cramming stuff in earlier today to try to get it done.\n\nMuch thanks to TRC for the compute time on v3-8 TPUs. All of my models are now available on my [Hugging Face profile](https://huggingface.co/nbroad).\n\n### What didn’t work\n- Attention heads on the end\n- Conv. layers on the end\n- Concatenating start logits to end logits\n- Translating at test time and doing cross-lingual QA (English questions with Hindi/Tamil contexts)\n- Monolingual models\n- “QA Pretraining” on tons of other languages before finetuning: Arabic, Persian, Bengali, German, Thai, Korean. Only English, German, Hindi, Telugu, and Tamil helped. I think they were the highest quality, and most of the others were poor translations.\n- [Splinter](https://arxiv.org/abs/2101.00438)/[FewShotQA](https://arxiv.org/pdf/2109.01951.pdf) \n    - I thought this would be perfect for this scenario because it excels at small datasets, but I could never get the model to converge\n    - [They even had starter code](https://github.com/oriram/splinter) but it was in Tensorflow 1 and I stubbornly tried to turn it into PyTorch.\n- NaturalQuestions/TriviaQA\n    - NQ is just a pain to work with because it’s absurdly large and the formatting is weird. I don’t think I ever got the training data to actually look right which is why I gave up on using it.\n    - Ran out of time before trying TriviaQA.\n- Training a question-generating model to label more data\n    - mt5 is huge and hard to train. I could only get a base model trained and it didn’t seem that good. [This article indicates](https://arxiv.org/pdf/1906.05416.pdf) that using millions of pseudolabels works, but I didn’t think I’d have the capacity to get this going.\n\n\n",
      "votes": 34
    },
    {
      "id": 1584856,
      "postDate": "2021-11-16T20:14:15.127Z",
      "content": "<p>Congrats Nicholas! I'd replace that turtle with a kangaroo, your jump in the last days was impressive! Awesome execution with Longformer, I was thinking about it but gave up without trying. I vote you the MVP of this competition, thanks for all the sharing and discussions! And congrats on the new job!</p>",
      "rawMarkdown": "Congrats Nicholas! I'd replace that turtle with a kangaroo, your jump in the last days was impressive! Awesome execution with Longformer, I was thinking about it but gave up without trying. I vote you the MVP of this competition, thanks for all the sharing and discussions! And congrats on the new job!",
      "votes": 3,
      "replies": [
        {
          "id": 1586036,
          "postDate": "2021-11-17T18:41:13.013Z",
          "content": "<p>Thanks for voting me MVP! I humbly accept the award 😄</p>\n<p>I tried hard this competition to learn as much as I could and share as much as possible while keeping a few tricks up my sleeve. Your early notebooks laid the foundation that many of us used throughout the competition.  Thank you for your hard work, and congratulations on the 1st place finish 🎉</p>\n<p>I'll change my emoji to a kangaroo now 😊</p>",
          "rawMarkdown": "Thanks for voting me MVP! I humbly accept the award 😄\n\nI tried hard this competition to learn as much as I could and share as much as possible while keeping a few tricks up my sleeve. Your early notebooks laid the foundation that many of us used throughout the competition.  Thank you for your hard work, and congratulations on the 1st place finish 🎉\n\nI'll change my emoji to a kangaroo now 😊",
          "votes": 1
        }
      ]
    },
    {
      "id": 1583729,
      "postDate": "2021-11-16T03:02:16.457Z",
      "content": "<p>Congrats <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> on results, nice jump</p>",
      "rawMarkdown": "Congrats @nbroad on results, nice jump",
      "votes": 3
    },
    {
      "id": 1589777,
      "postDate": "2021-11-20T15:02:09.130Z",
      "content": "<p>Well written <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !😊</p>",
      "rawMarkdown": "Well written @nbroad !😊",
      "votes": 1
    },
    {
      "id": 1587815,
      "postDate": "2021-11-19T00:23:44.230Z",
      "content": "<p>Thank you for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> and thank you for your post.</p>",
      "rawMarkdown": "Thank you for sharing @nbroad and thank you for your post.",
      "votes": 1
    },
    {
      "id": 1586347,
      "postDate": "2021-11-18T02:22:24.660Z",
      "content": "<p>Very well written, nice approach .. well deserved <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> on your win. Congratulations. </p>",
      "rawMarkdown": "Very well written, nice approach .. well deserved @nbroad on your win. Congratulations. ",
      "votes": 1
    },
    {
      "id": 1585168,
      "postDate": "2021-11-17T06:12:25.080Z",
      "content": "<p>Congrats. i'm envious of gold medal.</p>",
      "rawMarkdown": "Congrats. i'm envious of gold medal.",
      "votes": 1,
      "replies": [
        {
          "id": 1586368,
          "postDate": "2021-11-18T02:46:25.047Z",
          "content": "<p>Me too! I only got a silver 😄</p>",
          "rawMarkdown": "Me too! I only got a silver 😄"
        }
      ]
    },
    {
      "id": 1584499,
      "postDate": "2021-11-16T15:07:07.250Z",
      "content": "<p>Well done <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> and thank you for your post.</p>",
      "rawMarkdown": "Well done @nbroad and thank you for your post.\n",
      "votes": 1
    },
    {
      "id": 1584273,
      "postDate": "2021-11-16T12:05:50.233Z",
      "content": "<p>Just went thru ur solution again. The BigBird \"warm start\" thing is really amazing. I tried longformer-base from MLMed scratch and it worked really bad. Also, TPU and tensorflow are really hard for me. Implementing the novel thing with TPU is even more amazing.</p>",
      "rawMarkdown": "Just went thru ur solution again. The BigBird \"warm start\" thing is really amazing. I tried longformer-base from MLMed scratch and it worked really bad. Also, TPU and tensorflow are really hard for me. Implementing the novel thing with TPU is even more amazing.",
      "votes": 1,
      "replies": [
        {
          "id": 1584360,
          "postDate": "2021-11-16T13:36:28.510Z",
          "content": "<p>I also tried without doing a warm start and it was terrible 😄</p>\n<p>And I didn't use Tensorflow to train the BigBird model - I used Jax/Flax. <a href=\"https://github.com/huggingface/transformers/tree/master/examples/flax\" target=\"_blank\">Hugging Face has a couple of examples</a> that make it dead simple to get going. I'm sure there are more optimizations and details that I could have done, but I didn't have the time nor experience to learn them in time for this competition.</p>\n<p>Also, this would have been extremely expensive without using the TRC. I'm curious to see if Kaggle takes a stance on whether competitors can use TRC in the future</p>",
          "rawMarkdown": "I also tried without doing a warm start and it was terrible 😄\n\nAnd I didn't use Tensorflow to train the BigBird model - I used Jax/Flax. [Hugging Face has a couple of examples](https://github.com/huggingface/transformers/tree/master/examples/flax) that make it dead simple to get going. I'm sure there are more optimizations and details that I could have done, but I didn't have the time nor experience to learn them in time for this competition.\n\nAlso, this would have been extremely expensive without using the TRC. I'm curious to see if Kaggle takes a stance on whether competitors can use TRC in the future",
          "votes": 1
        }
      ]
    },
    {
      "id": 1583672,
      "postDate": "2021-11-16T01:52:58.053Z",
      "content": "<p>Great finish! Congratulations ! </p>",
      "rawMarkdown": "Great finish! Congratulations ! ",
      "votes": 1
    },
    {
      "id": 1583659,
      "postDate": "2021-11-16T01:39:38.853Z",
      "content": "<p>1024!!!! blew my mind. Congratulations for that huge jump :)</p>",
      "rawMarkdown": "1024!!!! blew my mind. Congratulations for that huge jump :)",
      "votes": 1,
      "replies": [
        {
          "id": 1583698,
          "postDate": "2021-11-16T02:16:10.793Z",
          "content": "<p>I wanted to run a 4k seq length model… but it was too big to train! </p>\n<p>Sometimes the shakeups work in your favor, sometimes they don't. They more experience you have, the less likely it will be to drop. Keep practicing!</p>\n<p>Thanks for all of the discussion and notebooks! See you in the next one!</p>\n<h1>👍</h1>",
          "rawMarkdown": "I wanted to run a 4k seq length model... but it was too big to train! \n\nSometimes the shakeups work in your favor, sometimes they don't. They more experience you have, the less likely it will be to drop. Keep practicing!\n\nThanks for all of the discussion and notebooks! See you in the next one!\n\n# 👍"
        }
      ]
    },
    {
      "id": 1583657,
      "postDate": "2021-11-16T01:38:22.983Z",
      "content": "<p>Good job for your first public competition! Compliments!</p>",
      "rawMarkdown": "Good job for your first public competition! Compliments!",
      "votes": 1
    },
    {
      "id": 1583576,
      "postDate": "2021-11-16T00:30:06.820Z",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> for actively sharing during the competition. 👍</p>",
      "rawMarkdown": "Thank you @nbroad for actively sharing during the competition. 👍",
      "votes": 1,
      "replies": [
        {
          "id": 1583640,
          "postDate": "2021-11-16T01:22:13.123Z",
          "content": "<p>Thanks for the discussions and posts! </p>",
          "rawMarkdown": "Thanks for the discussions and posts! ",
          "votes": 1
        }
      ]
    },
    {
      "id": 1583610,
      "postDate": "2021-11-16T01:01:26.197Z",
      "content": "<p>Congratulations. Fantastic solo finish! It appears that <code>RemBERT</code> and <code>MuRIL Large BigBird</code> did very well on private LB.</p>",
      "rawMarkdown": "Congratulations. Fantastic solo finish! It appears that `RemBERT` and `MuRIL Large BigBird` did very well on private LB.",
      "votes": 2,
      "replies": [
        {
          "id": 1583623,
          "postDate": "2021-11-16T01:12:39.480Z",
          "content": "<p>Thanks Chris! It means a lot to get praise from you 😊</p>",
          "rawMarkdown": "Thanks Chris! It means a lot to get praise from you 😊",
          "votes": 1
        }
      ]
    },
    {
      "id": 1693411,
      "postDate": "2022-02-16T16:53:59.253Z",
      "content": "<p>Thank you for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !</p>",
      "rawMarkdown": "Thank you for sharing @nbroad !"
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T16:21:03Z",
  "competition_id": 30060,
  "competition_slug": "chaii-hindi-and-tamil-question-answering",
  "team_id": 7251286,
  "solution_url": "/competitions/chaii-hindi-and-tamil-question-answering/writeups/nicholas-broad-17th-place-solution-bigbird"
}