{
  "id": 551651,
  "title": "2nd place solution",
  "content": "<p>Congratulations to all the winners! Thanks to the organizers for hosting such an interesting competition. We really enjoyed our journey and got a lot of inspiration from all the competitors! I am lucky enough to be a member of such a fruitful team and would like to thank all of my team members. Here we share our solution.</p>\n<h1>Preprocess</h1>\n<p>We found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on <a href=\"https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-get_starting_kit\" target=\"_blank\">NeurlPS 2022</a>. The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv. </p>\n<h1>Synthetic data</h1>\n<h3>synthetic questions</h3>\n<p>We generated synthetic data 3 times, let’s call them generation1, generation2, generation3.  <br>\nThe base approach is:</p>\n<ul>\n<li>provide LLM a misconception with few examples and let it generate questions  </li>\n<li>use qwen-math to solve the question to get the correct answer  </li>\n<li>use qwen-math to solve the question under the constraint of misconception to get the wrong answer  </li>\n<li>use gpt-4o-mini to score the quality of the question and choose those with score larger than 2 (max is 5)</li>\n</ul>\n<p>The difference between each generation is as follows.  <br>\nGeneration1:</p>\n<ul>\n<li>few shot examples: randomly sampled from train.csv</li>\n</ul>\n<p>Generation2:</p>\n<ul>\n<li>few shot examples: sample the question with the same misconception from train.csv and Generation1</li>\n</ul>\n<p>Generation3:</p>\n<ul>\n<li>The prompt of generation 3 is based on the prompt of <a href=\"https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/\" target=\"_blank\">this tech blog</a>  </li>\n<li>few shot examples: randomly sample 2 questions from train.csv, Generation1 and Generation2</li>\n</ul>\n<h3>misconception augmentation</h3>\n<p>The misconception only contains a short sentence. In order to make the embedding of the misconception more meaningful, we used LLM to generate explanation for each misconception. Since we don’t need to run inference for misconception in submission, the approach costs nothing in submission.  <br>\nThe prompt is as follows. The explanation of llama3.1-70b-Instruct and qwen2.5-72b-Instruct out-perform gpt-4o-mini in training retriever.  </p>\n<pre><code>system_prompt_template = \n\nuser_prompt_template = \n</code></pre>\n<h1>Chain of thought</h1>\n<p>We used qwen2.5-32B-Instruct-AWQ to generate chain-of-thought as additional input for the following retrieve and rerank. The prompt is as follows:  </p>\n<pre><code>system_prompt_template = \n\nuser_prompt_template =   \n</code></pre>\n<h1>Retrieve</h1>\n<h3>Training the Retrieve Models</h3>\n<p>We trained retriever with 2 different pipeline.  <br>\nPipeline1:</p>\n<ul>\n<li>backbone: Linq-AI-Research/Linq-Embed-Mistral  </li>\n<li>loss: Arcface  </li>\n<li>use Chain of thought as additional input in training and inference</li>\n</ul>\n<p>Pipeline2:</p>\n<ul>\n<li>backbone: Qwen/Qwen2.5-14B, Qwen/Qwen2.5-32B, Qwen/QwQ-32B-Preview  </li>\n<li>loss: MultipleNegativesRankingLoss  </li>\n<li>w/o Chain of thought (due to inference time)</li>\n</ul>\n<p>Single model performance is as follows.   </p>\n<table>\n<thead>\n<tr>\n<th>retriever</th>\n<th>synthetic data</th>\n<th>Private LB</th>\n<th>Public LB</th>\n<th>Inference time</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Linq-AI-Research/Linq-Embed-Mistral</td>\n<td>Generation123</td>\n<td>0.461</td>\n<td>0.484</td>\n<td>50 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-14B</td>\n<td>Generation12</td>\n<td>0.479</td>\n<td>0.507</td>\n<td>45 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-14B</td>\n<td>Generation123</td>\n<td>0.485</td>\n<td>0.492</td>\n<td>45 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-32B</td>\n<td>Generation123</td>\n<td>0.495</td>\n<td>0.536</td>\n<td>140 min</td>\n</tr>\n<tr>\n<td>Qwen/QwQ-32B-Preview</td>\n<td>Generation123</td>\n<td>0.500</td>\n<td>0.531</td>\n<td>140 min</td>\n</tr>\n</tbody>\n</table>\n<p>Our best submission used an ensemble of Mistral and 2 x qwen2.5-14B to give enough time to 72b rerank, the private LB and public LB is 0.513, 0.530.</p>\n<h3>Key Factors for Retriever Improvements</h3>\n<ol>\n<li><p><strong>Using Large Models</strong>    <br>\nAs is shown in the table above, the larger the better, GPU and Credit Card is all you need to get Power!!! Never open the billing page during the competition.</p>\n<ul>\n<li>qwen2.5-14B with Generation12: H100 about 2days  </li>\n<li>qwen2.5-14B with Generation123: H100 about 3days  </li>\n<li>qwen2.5-32B with Generation123(sampled): H100 about 5days  </li>\n<li>QWQ with Generation123(sampled): H100 about 5days</li></ul></li>\n<li><p><strong>Synthetic question</strong>    <br>\nI believe most of the participants used synthetic questions, the more high quality questions, the better performance. For our team, using gpt-4o-mini to filter high quality questions is the key.</p></li>\n<li><p><strong>Misconception augmentation</strong>    <br>\nUsing misconception augmentation significantly boosted retriever performance by about 2-4%.</p></li>\n<li><p><strong>Chain of Thought</strong>    <br>\nCoT is also useful. But for 14B and 32B models, adding CoT to the prompt will double the inference time.</p></li>\n<li><p><strong>Pooling Selection</strong>  <br>\nWe found that last token pooling achieved better performance than mean pooling in the Qwen model.</p></li>\n</ol>\n<h1>Rerank</h1>\n<p>We used a listwise reranker to refine the ranking of retrieved candidates. Our reranking process employed a sliding window approach: first, we used a lightweight LLM to reorder candidates ranked between 8th and 17th. Then, we leveraged larger models to finalize the rankings for the top 10 candidates.</p>\n<p>The LLMs for reranking were fine-tuned on a combination of synthetic and training data.</p>\n<ul>\n<li><strong>Window 1 (8th ~ 17th)</strong>    <ul>\n<li>Qwen2.5-14B-Instruct    </li></ul></li>\n<li><strong>Window 2 (1st ~ 10th)</strong>    <ul>\n<li>Qwen2.5-72B-Instruct    </li>\n<li>Llama-3.3-70B-Instruct  </li></ul></li>\n</ul>\n<h3>Key Factors for Reranking Improvements</h3>\n<ol>\n<li><p><strong>Using Large Models</strong>    <br>\nWe found that larger models (e.g., 72B parameters) consistently delivered stronger validation scores compared to smaller ones like 14B or 32B models. However, these larger models initially performed worse on the Public LB, leading to some concerns. Despite this, we trusted the validation scores and included the 72B model in our final submissions (special thanks to the three-submission rule!). Ultimately, the 72B model produced outstanding Private Leaderboard scores, helping us secure a prize.</p></li>\n<li><p><strong>Chain of Thought</strong>    <br>\nThe above CoT prompts greatly improved reranking performance.</p></li>\n<li><p><strong>Sliding Window</strong>    <br>\nInstead of increasing the number of candidates for reranking, applying the sliding window strategy multiple times to refine the top-10 rankings proved to be more effective.  <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5688805%2F781fda9fa53780767ec312a7e19c284c%2Fimage1.png?generation=1734186073680419&amp;alt=media\" alt=\"\"></p></li>\n<li><p><strong>Test-Time Augmentation</strong>    <br>\nDuring inference, we used TTA with some models by generating prompts in reverse order and averaging their scores with those from standard prompts. This technique provided a slight boost in accuracy.</p></li>\n</ol>\n<h3>Training the Rerank Models</h3>\n<p>We developed the QLoRA training code for our LLM rerankers based on the first-place solution from <a href=\"https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/\" target=\"_blank\">atmacup17</a>. Special thanks to <a href=\"https://www.kaggle.com/kcotton21\" target=\"_blank\">@kcotton21</a> for sharing such excellent solutions.</p>\n<p>Here are some tips that proved effective during the reranking model training:  </p>\n<ol>\n<li><p><strong>Randomizing Listwise Choices</strong>    <br>\nInstead of always using the top-10 candidates for prompts, we created prompts with a variety of top-N combinations such as top-3, top-5, top-15, and top-25.  </p></li>\n<li><p><strong>Synthetic Data</strong>    <br>\nThe synthetic data used for training the retriever was also helpful for training the reranker. In total, we trained on 8,000 records of training data (2 epochs) and 14,000 synthetic records, resulting in a combined dataset of 22,000 records.  </p></li>\n<li><p><strong>Negative Sample Mining</strong><br>\nTo mine negative samples, we used a hybrid retriever combining the fine-tuned <code>dunzhang/stella_en_400M_v5</code> model and TF-IDF. Each of the 22,000 positive samples had corresponding negative samples mined using this setup.  </p></li>\n</ol>\n<h4>Training Time</h4>\n<p>Qwen2.5-14B: ~2 hours on H100    <br>\nQwen2.5-72B: ~8 hours on H100  </p>\n<h3>Quantization</h3>\n<p>We used the <a href=\"https://github.com/intel/auto-round\" target=\"_blank\">intel/auto-round</a> library for quantizing the LLM rerankers. Compared to AutoGPTQ and AutoAWQ, this library was easier to use and caused minimal accuracy loss (typically less than 2%). Additionally, it could produce models compatible with vLLM.</p>\n<p>qwen2.5-72b-Instruct have some issues to run on multi GPU due to its intermediate_size(29568). Following the workaround provided by the <a href=\"https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting\" target=\"_blank\">document of gptq</a>, we padded the weights to 29696 and then performed quantization.</p>\n<p>For calibration, we used the training dataset. Below are the quantization parameters:  </p>\n<pre><code>bits, group_size, sym = 4, 128,   \nautoround = AutoRound(    \n    model, tokenizer, =bits, =group_size, =sym, =calib_prompts, =256,    \n    =512,    \n    =500,    \n)  \n</code></pre>\n<h3>Inference</h3>\n<p>We use vLLM for inference.</p>\n<p>By setting the <code>enabling_prefix_cache</code> to <code>True</code>, we were able to save approximately 10% of the inference time.</p>\n<p><a href=\"https://www.kaggle.com/jagatkiran\" target=\"_blank\">jagatkiran</a> shared his insights on performing  <a href=\"https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223\" target=\"_blank\">inference with a 72B LLM model</a>. In this competition, larger models tend to perform better, which has been very helpful for us.</p>\n<p>We implemented the reranker using <code>logits_processors</code> and <code>logprobs</code> by assigning a weight of +100 to specific tokens. This approach helped us establish the framework for the ranker. We also tried using a classification head directly, but the results were not satisfactory, and it was not easy to perform inference with vLLM. We believe this method could become a paradigm in future competitions.</p>\n<h3>Ablation</h3>\n<table>\n<thead>\n<tr>\n<th>Baseline (retriever)</th>\n<th>Qwen14B</th>\n<th>Qwen72B</th>\n<th>Llama70B</th>\n<th>8-17th Qwen14B</th>\n<th>Private LB</th>\n<th>Public LB</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>✅</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>0.513</td>\n<td>0.530</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td></td>\n<td></td>\n<td></td>\n<td>0.568</td>\n<td>0.583</td>\n</tr>\n<tr>\n<td>✅</td>\n<td></td>\n<td>✅</td>\n<td></td>\n<td></td>\n<td>0.593</td>\n<td>0.582</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td></td>\n<td>0.596</td>\n<td>0.609</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td><strong>0.604</strong></td>\n<td>0.622</td>\n</tr>\n</tbody>\n</table>\n<p>On the final day, we tried fine-tuning Nexusflow/Athene-V2-Chat instead of Llama70B.  Unfortunately, the submission with this model got timeout due to gpu and timeout issues, but it showed highly impressive performance on the leaderboard: 0.609.</p>\n<p>train code: <a href=\"https://github.com/wangqihanginthesky/Eedi_kaggle\\\" target=\"_blank\">https://github.com/wangqihanginthesky/Eedi_kaggle\\</a><br>\ninference code: <a href=\"https://www.kaggle.com/code/honglihang/2nd-place-inference-code\" target=\"_blank\">https://www.kaggle.com/code/honglihang/2nd-place-inference-code</a></p>\n<h1>Reference</h1>\n<p><a href=\"https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/\" target=\"_blank\">LLMにおける合成データセットによる数学推論タスクの精度向上の検討</a>  <br>\n<a href=\"https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-overview\" target=\"_blank\">NeurIPS 2022 CausalML Challenge: Causal Insights for Learning Paths in Education</a>  <br>\n<a href=\"https://arxiv.org/pdf/2310.09497\" target=\"_blank\">A Setwise Approach for Effective and Highly Efficient Zero-shot Ranking with Large Language Models</a>  <br>\n<a href=\"https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223\" target=\"_blank\">Qwen2.5-72B &amp; Llama 3.3-70B on 2xT4(questionable performance)</a>  <br>\n<a href=\"https://arxiv.org/abs/2309.05516\" target=\"_blank\">Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs</a>  <br>\n<a href=\"https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/\" target=\"_blank\">1st place solution from atmacup17</a>  <br>\n<a href=\"https://openreview.net/forum?id=sv0E1mBhu8\" target=\"_blank\">Winning Amazon KDD Cup'24</a>  <br>\n<a href=\"https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting\" target=\"_blank\">Qwen GPTQ Troubleshooting</a></p>",
  "comments": [
    {
      "id": 3072302,
      "author_name": "ktr",
      "author_url": "",
      "post_date": "2024-12-15T02:26:57.653000",
      "content": "<p>Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.</p>\n<p>I can see from your post that you have made good use of 72b.<br>\nDid you train the 72b with QLoRA, merge the Adapter, and then quantize it? Empirically, I think that merge Adapter trained with QLoRA has a significant performance degradation.</p>",
      "votes": 3,
      "replies": [
        {
          "id": 3072345,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2024-12-15T04:05:18.547000",
          "content": "<p>Thanks very much for your solution in atmacup and congratulations!<br>\nYes, we trained 72b with QLoRa, merge the Adapter and then perform quantization. In our offline experiment, the performance did not show much degradation(0.7011 -&gt; 0.6988).<br>\n<a href=\"https://www.kaggle.com/yokuyama\" target=\"_blank\">@yokuyama</a> developed the training of rerank and I heard that he optimized the hyper-parameter during quantize. auto-round is very powerful and easy to use, better than auto-awq in our experiments.</p>",
          "votes": 4,
          "replies": [
            {
              "id": 3072365,
              "author_name": "ktr",
              "author_url": "",
              "post_date": "2024-12-15T04:50:25.027000",
              "content": "<p>Thank you!<br>\nSo there isn't much accuracy degradation.<br>\nI've never quantized after merging the QLoRA adapter. I'll experiment with auto-round.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3072270,
      "author_name": "kuto",
      "author_url": "",
      "post_date": "2024-12-15T01:04:23.557000",
      "content": "<p>Congratulations and thank you for sharing your solution! It was very interesting to read.</p>\n<p>I have two questions.</p>\n<ol>\n<li><p>Are the prompt and output formats different between training and inference for the reranker? I understood it as predicting Yes/No for a single misconception during training, and rearranging multiple misconceptions during inference. Is that correct?</p></li>\n<li><p>I didn’t quite understand the part where the special token is assigned a weight of 100. Could you explain that in a bit more detail?</p></li>\n</ol>\n<blockquote>\n  <p>We implemented the reranker using logits_processors and logprobs by assigning a weight of +100 to specific tokens.</p>\n</blockquote>",
      "votes": 1,
      "replies": [
        {
          "id": 3072332,
          "author_name": "Qihang Wang",
          "author_url": "",
          "post_date": "2024-12-15T03:36:58.233000",
          "content": "<p>Thank you for your question.</p>\n<p>The training and inference processes are consistent, both involving options like A, B, C, D …</p>\n<p>Regarding the weight of the special token: for these options (A, B, C, D,…), we apply a logit_bias of +100 to ensure that the model prioritizes these letters as output.    (set <code>scores[self.allowed_ids] += 100</code> in logitprocessor's <strong>call</strong>)</p>",
          "votes": 3,
          "replies": [
            {
              "id": 3072403,
              "author_name": "kuto",
              "author_url": "",
              "post_date": "2024-12-15T06:10:51.583000",
              "content": "<p>I see that we can control the weight with logitsprocessor. I did not know that, thank you!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3072392,
      "author_name": "MrSimple",
      "author_url": "",
      "post_date": "2024-12-15T05:33:15.227000",
      "content": "<p>Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3072099,
      "author_name": "Yi-Chia Chen",
      "author_url": "",
      "post_date": "2024-12-14T17:26:21.777000",
      "content": "<blockquote>\n  <p>\"We found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on NeurlPS 2022. The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv.\"</p>\n</blockquote>\n<p>That's cool! Have you analyzed how much improvement the parent subject information brings to the model's performance?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3072350,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2024-12-15T04:10:21.173000",
          "content": "<p>Not sure enough because I collected external data at the start of the competition. Personally I think the gain is marginal because our 14B and 32B retriever did not use this information. However, the parent subject is used as input of Chain-of-thought, Rerank and synthetic data generation, which may give the model some additional context.</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 3072353,
          "author_name": "RihanPiggy",
          "author_url": "",
          "post_date": "2024-12-15T04:16:05.690000",
          "content": "<p>By the way, I saw that you are an double degree exchange student in waseda. I am also an alumini of waseda's double degree program!!<br>\nI majored political science and economics in waseda with scholarship from BaiXian, are you in the same program?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 3072724,
              "author_name": "Yi-Chia Chen",
              "author_url": "",
              "post_date": "2024-12-15T15:36:32.737000",
              "content": "<p>Thank you for your response!<br>\nAnd it's great to meet you, senpai! But I'm actually in a different program - the double degree partnership between National Taiwan University and Waseda.<br>\nAlso, congratulations! You'll become a Grandmaster after this competition, right? ✨</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3072764,
              "author_name": "RihanPiggy",
              "author_url": "",
              "post_date": "2024-12-15T16:12:29.227000",
              "content": "<p>Oh, really! There were students from various countries(including Taiwan) in my program, so I thought maybe you are in the same one as mine.</p>\n<p>Congratulations to you too. It's amazing to see the magic of multiplying the unseen logits, which made our team feel stomachache in the final days…<br>\nYes! waiting for the finalize and become Grandmaster😆 And you will become a Master with solo gold!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "comment_count": 12,
  "messages": [
    {
      "id": 3071931,
      "postDate": "2024-12-14T14:29:57.250Z",
      "content": "<p>Congratulations to all the winners! Thanks to the organizers for hosting such an interesting competition. We really enjoyed our journey and got a lot of inspiration from all the competitors! I am lucky enough to be a member of such a fruitful team and would like to thank all of my team members. Here we share our solution.</p>\n<h1>Preprocess</h1>\n<p>We found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on <a href=\"https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-get_starting_kit\" target=\"_blank\">NeurlPS 2022</a>. The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv. </p>\n<h1>Synthetic data</h1>\n<h3>synthetic questions</h3>\n<p>We generated synthetic data 3 times, let’s call them generation1, generation2, generation3.  <br>\nThe base approach is:</p>\n<ul>\n<li>provide LLM a misconception with few examples and let it generate questions  </li>\n<li>use qwen-math to solve the question to get the correct answer  </li>\n<li>use qwen-math to solve the question under the constraint of misconception to get the wrong answer  </li>\n<li>use gpt-4o-mini to score the quality of the question and choose those with score larger than 2 (max is 5)</li>\n</ul>\n<p>The difference between each generation is as follows.  <br>\nGeneration1:</p>\n<ul>\n<li>few shot examples: randomly sampled from train.csv</li>\n</ul>\n<p>Generation2:</p>\n<ul>\n<li>few shot examples: sample the question with the same misconception from train.csv and Generation1</li>\n</ul>\n<p>Generation3:</p>\n<ul>\n<li>The prompt of generation 3 is based on the prompt of <a href=\"https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/\" target=\"_blank\">this tech blog</a>  </li>\n<li>few shot examples: randomly sample 2 questions from train.csv, Generation1 and Generation2</li>\n</ul>\n<h3>misconception augmentation</h3>\n<p>The misconception only contains a short sentence. In order to make the embedding of the misconception more meaningful, we used LLM to generate explanation for each misconception. Since we don’t need to run inference for misconception in submission, the approach costs nothing in submission.  <br>\nThe prompt is as follows. The explanation of llama3.1-70b-Instruct and qwen2.5-72b-Instruct out-perform gpt-4o-mini in training retriever.  </p>\n<pre><code>system_prompt_template = \n\nuser_prompt_template = \n</code></pre>\n<h1>Chain of thought</h1>\n<p>We used qwen2.5-32B-Instruct-AWQ to generate chain-of-thought as additional input for the following retrieve and rerank. The prompt is as follows:  </p>\n<pre><code>system_prompt_template = \n\nuser_prompt_template =   \n</code></pre>\n<h1>Retrieve</h1>\n<h3>Training the Retrieve Models</h3>\n<p>We trained retriever with 2 different pipeline.  <br>\nPipeline1:</p>\n<ul>\n<li>backbone: Linq-AI-Research/Linq-Embed-Mistral  </li>\n<li>loss: Arcface  </li>\n<li>use Chain of thought as additional input in training and inference</li>\n</ul>\n<p>Pipeline2:</p>\n<ul>\n<li>backbone: Qwen/Qwen2.5-14B, Qwen/Qwen2.5-32B, Qwen/QwQ-32B-Preview  </li>\n<li>loss: MultipleNegativesRankingLoss  </li>\n<li>w/o Chain of thought (due to inference time)</li>\n</ul>\n<p>Single model performance is as follows.   </p>\n<table>\n<thead>\n<tr>\n<th>retriever</th>\n<th>synthetic data</th>\n<th>Private LB</th>\n<th>Public LB</th>\n<th>Inference time</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Linq-AI-Research/Linq-Embed-Mistral</td>\n<td>Generation123</td>\n<td>0.461</td>\n<td>0.484</td>\n<td>50 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-14B</td>\n<td>Generation12</td>\n<td>0.479</td>\n<td>0.507</td>\n<td>45 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-14B</td>\n<td>Generation123</td>\n<td>0.485</td>\n<td>0.492</td>\n<td>45 min</td>\n</tr>\n<tr>\n<td>Qwen/Qwen2.5-32B</td>\n<td>Generation123</td>\n<td>0.495</td>\n<td>0.536</td>\n<td>140 min</td>\n</tr>\n<tr>\n<td>Qwen/QwQ-32B-Preview</td>\n<td>Generation123</td>\n<td>0.500</td>\n<td>0.531</td>\n<td>140 min</td>\n</tr>\n</tbody>\n</table>\n<p>Our best submission used an ensemble of Mistral and 2 x qwen2.5-14B to give enough time to 72b rerank, the private LB and public LB is 0.513, 0.530.</p>\n<h3>Key Factors for Retriever Improvements</h3>\n<ol>\n<li><p><strong>Using Large Models</strong>    <br>\nAs is shown in the table above, the larger the better, GPU and Credit Card is all you need to get Power!!! Never open the billing page during the competition.</p>\n<ul>\n<li>qwen2.5-14B with Generation12: H100 about 2days  </li>\n<li>qwen2.5-14B with Generation123: H100 about 3days  </li>\n<li>qwen2.5-32B with Generation123(sampled): H100 about 5days  </li>\n<li>QWQ with Generation123(sampled): H100 about 5days</li></ul></li>\n<li><p><strong>Synthetic question</strong>    <br>\nI believe most of the participants used synthetic questions, the more high quality questions, the better performance. For our team, using gpt-4o-mini to filter high quality questions is the key.</p></li>\n<li><p><strong>Misconception augmentation</strong>    <br>\nUsing misconception augmentation significantly boosted retriever performance by about 2-4%.</p></li>\n<li><p><strong>Chain of Thought</strong>    <br>\nCoT is also useful. But for 14B and 32B models, adding CoT to the prompt will double the inference time.</p></li>\n<li><p><strong>Pooling Selection</strong>  <br>\nWe found that last token pooling achieved better performance than mean pooling in the Qwen model.</p></li>\n</ol>\n<h1>Rerank</h1>\n<p>We used a listwise reranker to refine the ranking of retrieved candidates. Our reranking process employed a sliding window approach: first, we used a lightweight LLM to reorder candidates ranked between 8th and 17th. Then, we leveraged larger models to finalize the rankings for the top 10 candidates.</p>\n<p>The LLMs for reranking were fine-tuned on a combination of synthetic and training data.</p>\n<ul>\n<li><strong>Window 1 (8th ~ 17th)</strong>    <ul>\n<li>Qwen2.5-14B-Instruct    </li></ul></li>\n<li><strong>Window 2 (1st ~ 10th)</strong>    <ul>\n<li>Qwen2.5-72B-Instruct    </li>\n<li>Llama-3.3-70B-Instruct  </li></ul></li>\n</ul>\n<h3>Key Factors for Reranking Improvements</h3>\n<ol>\n<li><p><strong>Using Large Models</strong>    <br>\nWe found that larger models (e.g., 72B parameters) consistently delivered stronger validation scores compared to smaller ones like 14B or 32B models. However, these larger models initially performed worse on the Public LB, leading to some concerns. Despite this, we trusted the validation scores and included the 72B model in our final submissions (special thanks to the three-submission rule!). Ultimately, the 72B model produced outstanding Private Leaderboard scores, helping us secure a prize.</p></li>\n<li><p><strong>Chain of Thought</strong>    <br>\nThe above CoT prompts greatly improved reranking performance.</p></li>\n<li><p><strong>Sliding Window</strong>    <br>\nInstead of increasing the number of candidates for reranking, applying the sliding window strategy multiple times to refine the top-10 rankings proved to be more effective.  <br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5688805%2F781fda9fa53780767ec312a7e19c284c%2Fimage1.png?generation=1734186073680419&amp;alt=media\" alt=\"\"></p></li>\n<li><p><strong>Test-Time Augmentation</strong>    <br>\nDuring inference, we used TTA with some models by generating prompts in reverse order and averaging their scores with those from standard prompts. This technique provided a slight boost in accuracy.</p></li>\n</ol>\n<h3>Training the Rerank Models</h3>\n<p>We developed the QLoRA training code for our LLM rerankers based on the first-place solution from <a href=\"https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/\" target=\"_blank\">atmacup17</a>. Special thanks to <a href=\"https://www.kaggle.com/kcotton21\" target=\"_blank\">@kcotton21</a> for sharing such excellent solutions.</p>\n<p>Here are some tips that proved effective during the reranking model training:  </p>\n<ol>\n<li><p><strong>Randomizing Listwise Choices</strong>    <br>\nInstead of always using the top-10 candidates for prompts, we created prompts with a variety of top-N combinations such as top-3, top-5, top-15, and top-25.  </p></li>\n<li><p><strong>Synthetic Data</strong>    <br>\nThe synthetic data used for training the retriever was also helpful for training the reranker. In total, we trained on 8,000 records of training data (2 epochs) and 14,000 synthetic records, resulting in a combined dataset of 22,000 records.  </p></li>\n<li><p><strong>Negative Sample Mining</strong><br>\nTo mine negative samples, we used a hybrid retriever combining the fine-tuned <code>dunzhang/stella_en_400M_v5</code> model and TF-IDF. Each of the 22,000 positive samples had corresponding negative samples mined using this setup.  </p></li>\n</ol>\n<h4>Training Time</h4>\n<p>Qwen2.5-14B: ~2 hours on H100    <br>\nQwen2.5-72B: ~8 hours on H100  </p>\n<h3>Quantization</h3>\n<p>We used the <a href=\"https://github.com/intel/auto-round\" target=\"_blank\">intel/auto-round</a> library for quantizing the LLM rerankers. Compared to AutoGPTQ and AutoAWQ, this library was easier to use and caused minimal accuracy loss (typically less than 2%). Additionally, it could produce models compatible with vLLM.</p>\n<p>qwen2.5-72b-Instruct have some issues to run on multi GPU due to its intermediate_size(29568). Following the workaround provided by the <a href=\"https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting\" target=\"_blank\">document of gptq</a>, we padded the weights to 29696 and then performed quantization.</p>\n<p>For calibration, we used the training dataset. Below are the quantization parameters:  </p>\n<pre><code>bits, group_size, sym = 4, 128,   \nautoround = AutoRound(    \n    model, tokenizer, =bits, =group_size, =sym, =calib_prompts, =256,    \n    =512,    \n    =500,    \n)  \n</code></pre>\n<h3>Inference</h3>\n<p>We use vLLM for inference.</p>\n<p>By setting the <code>enabling_prefix_cache</code> to <code>True</code>, we were able to save approximately 10% of the inference time.</p>\n<p><a href=\"https://www.kaggle.com/jagatkiran\" target=\"_blank\">jagatkiran</a> shared his insights on performing  <a href=\"https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223\" target=\"_blank\">inference with a 72B LLM model</a>. In this competition, larger models tend to perform better, which has been very helpful for us.</p>\n<p>We implemented the reranker using <code>logits_processors</code> and <code>logprobs</code> by assigning a weight of +100 to specific tokens. This approach helped us establish the framework for the ranker. We also tried using a classification head directly, but the results were not satisfactory, and it was not easy to perform inference with vLLM. We believe this method could become a paradigm in future competitions.</p>\n<h3>Ablation</h3>\n<table>\n<thead>\n<tr>\n<th>Baseline (retriever)</th>\n<th>Qwen14B</th>\n<th>Qwen72B</th>\n<th>Llama70B</th>\n<th>8-17th Qwen14B</th>\n<th>Private LB</th>\n<th>Public LB</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>✅</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>0.513</td>\n<td>0.530</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td></td>\n<td></td>\n<td></td>\n<td>0.568</td>\n<td>0.583</td>\n</tr>\n<tr>\n<td>✅</td>\n<td></td>\n<td>✅</td>\n<td></td>\n<td></td>\n<td>0.593</td>\n<td>0.582</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td></td>\n<td>0.596</td>\n<td>0.609</td>\n</tr>\n<tr>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td>✅</td>\n<td><strong>0.604</strong></td>\n<td>0.622</td>\n</tr>\n</tbody>\n</table>\n<p>On the final day, we tried fine-tuning Nexusflow/Athene-V2-Chat instead of Llama70B.  Unfortunately, the submission with this model got timeout due to gpu and timeout issues, but it showed highly impressive performance on the leaderboard: 0.609.</p>\n<p>train code: <a href=\"https://github.com/wangqihanginthesky/Eedi_kaggle\\\" target=\"_blank\">https://github.com/wangqihanginthesky/Eedi_kaggle\\</a><br>\ninference code: <a href=\"https://www.kaggle.com/code/honglihang/2nd-place-inference-code\" target=\"_blank\">https://www.kaggle.com/code/honglihang/2nd-place-inference-code</a></p>\n<h1>Reference</h1>\n<p><a href=\"https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/\" target=\"_blank\">LLMにおける合成データセットによる数学推論タスクの精度向上の検討</a>  <br>\n<a href=\"https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-overview\" target=\"_blank\">NeurIPS 2022 CausalML Challenge: Causal Insights for Learning Paths in Education</a>  <br>\n<a href=\"https://arxiv.org/pdf/2310.09497\" target=\"_blank\">A Setwise Approach for Effective and Highly Efficient Zero-shot Ranking with Large Language Models</a>  <br>\n<a href=\"https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223\" target=\"_blank\">Qwen2.5-72B &amp; Llama 3.3-70B on 2xT4(questionable performance)</a>  <br>\n<a href=\"https://arxiv.org/abs/2309.05516\" target=\"_blank\">Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs</a>  <br>\n<a href=\"https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/\" target=\"_blank\">1st place solution from atmacup17</a>  <br>\n<a href=\"https://openreview.net/forum?id=sv0E1mBhu8\" target=\"_blank\">Winning Amazon KDD Cup'24</a>  <br>\n<a href=\"https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting\" target=\"_blank\">Qwen GPTQ Troubleshooting</a></p>",
      "rawMarkdown": "Congratulations to all the winners! Thanks to the organizers for hosting such an interesting competition. We really enjoyed our journey and got a lot of inspiration from all the competitors! I am lucky enough to be a member of such a fruitful team and would like to thank all of my team members. Here we share our solution.\n\n# Preprocess\n\nWe found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on [NeurlPS 2022](https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-get_starting_kit). The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv. \n\n# Synthetic data\n\n### synthetic questions\n\nWe generated synthetic data 3 times, let’s call them generation1, generation2, generation3.  \nThe base approach is:\n\n- provide LLM a misconception with few examples and let it generate questions  \n- use qwen-math to solve the question to get the correct answer  \n- use qwen-math to solve the question under the constraint of misconception to get the wrong answer  \n- use gpt-4o-mini to score the quality of the question and choose those with score larger than 2 (max is 5)\n\nThe difference between each generation is as follows.  \nGeneration1:\n\n- few shot examples: randomly sampled from train.csv\n\nGeneration2:\n\n- few shot examples: sample the question with the same misconception from train.csv and Generation1\n\nGeneration3:\n\n- The prompt of generation 3 is based on the prompt of [this tech blog](https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/)  \n- few shot examples: randomly sample 2 questions from train.csv, Generation1 and Generation2\n\n### misconception augmentation\n\nThe misconception only contains a short sentence. In order to make the embedding of the misconception more meaningful, we used LLM to generate explanation for each misconception. Since we don’t need to run inference for misconception in submission, the approach costs nothing in submission.  \nThe prompt is as follows. The explanation of llama3.1-70b-Instruct and qwen2.5-72b-Instruct out-perform gpt-4o-mini in training retriever.  \n```  \nsystem_prompt_template = 'You are an excellent math teacher about to teach students of year group 1 to 14. The subject of your lesson includes Number, Algebra, Data and Statistics, Geometry and Measure. You will be provided a misconception that your students may have. Please explain the misconception in detail and provide some short cases when the misconception will occur. No need to provide the correct approach. The explanation should be in format of \"Explanation: {explanation}\"'\n\nuser_prompt_template = 'Misconception: {misconception}'  \n```\n\n# Chain of thought\n\nWe used qwen2.5-32B-Instruct-AWQ to generate chain-of-thought as additional input for the following retrieve and rerank. The prompt is as follows:  \n```  \nsystem_prompt_template = \"You are an excellent math teacher about to teach students of year group 1 to 14. The detail of your lesson is as follows. Subject:{first_subject}, Topic: {second_subject}, Subtopic {third_subject}. Your students have made a mistake in the following question. Please explain the mistake step by step briefly and describe the misunderstanding behind the wrong answer at conceptual level. No need to provide the correct way to achieve the answer.\"\n\nuser_prompt_template = \"Question: {question_text}\\nCorrect Answer: {correct_text}\\nWrong Answer of your students: {answer_text}\\n\\nExplanation: \\nMisunderstanding: \"  \n```\n\n# Retrieve\n### Training the Retrieve Models    \nWe trained retriever with 2 different pipeline.  \nPipeline1:\n\n- backbone: Linq-AI-Research/Linq-Embed-Mistral  \n- loss: Arcface  \n- use Chain of thought as additional input in training and inference\n\nPipeline2:\n\n- backbone: Qwen/Qwen2.5-14B, Qwen/Qwen2.5-32B, Qwen/QwQ-32B-Preview  \n- loss: MultipleNegativesRankingLoss  \n- w/o Chain of thought (due to inference time)\n\nSingle model performance is as follows.   \n|retriever|synthetic data|Private LB|Public LB|Inference time|  \n|:----|:----|:----|:----|:----|  \n|Linq-AI-Research/Linq-Embed-Mistral|Generation123|0.461|0.484|50 min|  \n|Qwen/Qwen2.5-14B|Generation12|0.479|0.507|45 min|  \n|Qwen/Qwen2.5-14B|Generation123|0.485|0.492|45 min|  \n|Qwen/Qwen2.5-32B|Generation123|0.495|0.536|140 min|  \n|Qwen/QwQ-32B-Preview|Generation123|0.500|0.531|140 min|  \n\nOur best submission used an ensemble of Mistral and 2 x qwen2.5-14B to give enough time to 72b rerank, the private LB and public LB is 0.513, 0.530.\n\n### Key Factors for Retriever Improvements\n\n1. **Using Large Models**    \n   As is shown in the table above, the larger the better, GPU and Credit Card is all you need to get Power!!! Never open the billing page during the competition.\n\n    - qwen2.5-14B with Generation12: H100 about 2days  \n    - qwen2.5-14B with Generation123: H100 about 3days  \n    - qwen2.5-32B with Generation123(sampled): H100 about 5days  \n    - QWQ with Generation123(sampled): H100 about 5days\n\n2. **Synthetic question**    \n   I believe most of the participants used synthetic questions, the more high quality questions, the better performance. For our team, using gpt-4o-mini to filter high quality questions is the key.\n\n3. **Misconception augmentation**    \n   Using misconception augmentation significantly boosted retriever performance by about 2-4%.\n\n4. **Chain of Thought**    \n   CoT is also useful. But for 14B and 32B models, adding CoT to the prompt will double the inference time.\n\n5. **Pooling Selection**  \n   We found that last token pooling achieved better performance than mean pooling in the Qwen model.\n\n# Rerank\n\nWe used a listwise reranker to refine the ranking of retrieved candidates. Our reranking process employed a sliding window approach: first, we used a lightweight LLM to reorder candidates ranked between 8th and 17th. Then, we leveraged larger models to finalize the rankings for the top 10 candidates.\n\nThe LLMs for reranking were fine-tuned on a combination of synthetic and training data.\n\n- **Window 1 (8th ~ 17th)**    \n  - Qwen2.5-14B-Instruct    \n- **Window 2 (1st ~ 10th)**    \n  - Qwen2.5-72B-Instruct    \n  - Llama-3.3-70B-Instruct  \n\n### Key Factors for Reranking Improvements\n\n1. **Using Large Models**    \n   We found that larger models (e.g., 72B parameters) consistently delivered stronger validation scores compared to smaller ones like 14B or 32B models. However, these larger models initially performed worse on the Public LB, leading to some concerns. Despite this, we trusted the validation scores and included the 72B model in our final submissions (special thanks to the three-submission rule!). Ultimately, the 72B model produced outstanding Private Leaderboard scores, helping us secure a prize.\n\n2. **Chain of Thought**    \n   The above CoT prompts greatly improved reranking performance.\n\n3. **Sliding Window**    \n   Instead of increasing the number of candidates for reranking, applying the sliding window strategy multiple times to refine the top-10 rankings proved to be more effective.  \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5688805%2F781fda9fa53780767ec312a7e19c284c%2Fimage1.png?generation=1734186073680419&alt=media)\n\n4. **Test-Time Augmentation**    \n   During inference, we used TTA with some models by generating prompts in reverse order and averaging their scores with those from standard prompts. This technique provided a slight boost in accuracy.\n\n### Training the Rerank Models    \nWe developed the QLoRA training code for our LLM rerankers based on the first-place solution from [atmacup17](https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/). Special thanks to [@kcotton21](https://www.kaggle.com/kcotton21) for sharing such excellent solutions.\n\nHere are some tips that proved effective during the reranking model training:  \n\n1. **Randomizing Listwise Choices**    \n   Instead of always using the top-10 candidates for prompts, we created prompts with a variety of top-N combinations such as top-3, top-5, top-15, and top-25.  \n\n2. **Synthetic Data**    \n   The synthetic data used for training the retriever was also helpful for training the reranker. In total, we trained on 8,000 records of training data (2 epochs) and 14,000 synthetic records, resulting in a combined dataset of 22,000 records.  \n\n3. **Negative Sample Mining**\n   To mine negative samples, we used a hybrid retriever combining the fine-tuned `dunzhang/stella_en_400M_v5` model and TF-IDF. Each of the 22,000 positive samples had corresponding negative samples mined using this setup.  \n\n#### Training Time  \nQwen2.5-14B: ~2 hours on H100    \nQwen2.5-72B: ~8 hours on H100  \n\n### Quantization    \nWe used the [intel/auto-round](https://github.com/intel/auto-round) library for quantizing the LLM rerankers. Compared to AutoGPTQ and AutoAWQ, this library was easier to use and caused minimal accuracy loss (typically less than 2%). Additionally, it could produce models compatible with vLLM.\n\nqwen2.5-72b-Instruct have some issues to run on multi GPU due to its intermediate_size(29568). Following the workaround provided by the [document of gptq](https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting), we padded the weights to 29696 and then performed quantization.\n\nFor calibration, we used the training dataset. Below are the quantization parameters:  \n\n```\nbits, group_size, sym = 4, 128, True  \nautoround = AutoRound(    \n    model, tokenizer, bits=bits, group_size=group_size, sym=sym, dataset=calib_prompts, seqlen=256,    \n    nsamples=512,    \n    iters=500,    \n)  \n```\n\n### Inference  \nWe use vLLM for inference.\n\nBy setting the `enabling_prefix_cache` to `True`, we were able to save approximately 10% of the inference time.\n\n[jagatkiran](https://www.kaggle.com/jagatkiran) shared his insights on performing  [inference with a 72B LLM model](https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223). In this competition, larger models tend to perform better, which has been very helpful for us.\n\nWe implemented the reranker using `logits_processors` and `logprobs` by assigning a weight of +100 to specific tokens. This approach helped us establish the framework for the ranker. We also tried using a classification head directly, but the results were not satisfactory, and it was not easy to perform inference with vLLM. We believe this method could become a paradigm in future competitions.\n\n### Ablation  \n|Baseline (retriever)|Qwen14B|Qwen72B|Llama70B|8-17th Qwen14B|Private LB|Public LB|  \n|:----|:----|:----|:----|:----|:----|:----|  \n|✅| | | | |0.513|0.530|  \n|✅|✅| | | |0.568|0.583|  \n|✅| |✅| | |0.593|0.582|  \n|✅|✅|✅|✅| |0.596|0.609|  \n|✅|✅|✅|✅|✅|**0.604**|0.622|\n\nOn the final day, we tried fine-tuning Nexusflow/Athene-V2-Chat instead of Llama70B.  Unfortunately, the submission with this model got timeout due to gpu and timeout issues, but it showed highly impressive performance on the leaderboard: 0.609.\n\ntrain code: https://github.com/wangqihanginthesky/Eedi_kaggle\\\ninference code: https://www.kaggle.com/code/honglihang/2nd-place-inference-code\n\n# Reference  \n[LLMにおける合成データセットによる数学推論タスクの精度向上の検討](https://tech.preferred.jp/ja/blog/llm-synthetic-dataset-for-math/)  \n[NeurIPS 2022 CausalML Challenge: Causal Insights for Learning Paths in Education](https://codalab.lisn.upsaclay.fr/competitions/5626#learn_the_details-overview)  \n[A Setwise Approach for Effective and Highly Efficient Zero-shot Ranking with Large Language Models](https://arxiv.org/pdf/2310.09497)  \n[Qwen2.5-72B & Llama 3.3-70B on 2xT4(questionable performance)](https://www.kaggle.com/competitions/eedi-mining-misconceptions-in-mathematics/discussion/550223)  \n[Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs](https://arxiv.org/abs/2309.05516)  \n[1st place solution from atmacup17](https://www.guruguru.science/competitions/24/discussions/21027ff1-2074-4e21-a249-b2d4170bd516/)  \n[Winning Amazon KDD Cup'24](https://openreview.net/forum?id=sv0E1mBhu8)  \n[Qwen GPTQ Troubleshooting](https://qwen.readthedocs.io/en/latest/quantization/gptq.html#troubleshooting)",
      "votes": 38
    },
    {
      "id": 3072302,
      "postDate": "2024-12-15T02:26:57.653Z",
      "content": "<p>Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.</p>\n<p>I can see from your post that you have made good use of 72b.<br>\nDid you train the 72b with QLoRA, merge the Adapter, and then quantize it? Empirically, I think that merge Adapter trained with QLoRA has a significant performance degradation.</p>",
      "rawMarkdown": "Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.\n\nI can see from your post that you have made good use of 72b.\nDid you train the 72b with QLoRA, merge the Adapter, and then quantize it? Empirically, I think that merge Adapter trained with QLoRA has a significant performance degradation.",
      "votes": 3,
      "replies": [
        {
          "id": 3072345,
          "postDate": "2024-12-15T04:05:18.547Z",
          "content": "<p>Thanks very much for your solution in atmacup and congratulations!<br>\nYes, we trained 72b with QLoRa, merge the Adapter and then perform quantization. In our offline experiment, the performance did not show much degradation(0.7011 -&gt; 0.6988).<br>\n<a href=\"https://www.kaggle.com/yokuyama\" target=\"_blank\">@yokuyama</a> developed the training of rerank and I heard that he optimized the hyper-parameter during quantize. auto-round is very powerful and easy to use, better than auto-awq in our experiments.</p>",
          "rawMarkdown": "Thanks very much for your solution in atmacup and congratulations!\nYes, we trained 72b with QLoRa, merge the Adapter and then perform quantization. In our offline experiment, the performance did not show much degradation(0.7011 -> 0.6988).\n@yokuyama developed the training of rerank and I heard that he optimized the hyper-parameter during quantize. auto-round is very powerful and easy to use, better than auto-awq in our experiments.",
          "votes": 4,
          "replies": [
            {
              "id": 3072365,
              "postDate": "2024-12-15T04:50:25.027Z",
              "content": "<p>Thank you!<br>\nSo there isn't much accuracy degradation.<br>\nI've never quantized after merging the QLoRA adapter. I'll experiment with auto-round.</p>",
              "rawMarkdown": "Thank you!\nSo there isn't much accuracy degradation.\nI've never quantized after merging the QLoRA adapter. I'll experiment with auto-round.",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 3072270,
      "postDate": "2024-12-15T01:04:23.557Z",
      "content": "<p>Congratulations and thank you for sharing your solution! It was very interesting to read.</p>\n<p>I have two questions.</p>\n<ol>\n<li><p>Are the prompt and output formats different between training and inference for the reranker? I understood it as predicting Yes/No for a single misconception during training, and rearranging multiple misconceptions during inference. Is that correct?</p></li>\n<li><p>I didn’t quite understand the part where the special token is assigned a weight of 100. Could you explain that in a bit more detail?</p></li>\n</ol>\n<blockquote>\n  <p>We implemented the reranker using logits_processors and logprobs by assigning a weight of +100 to specific tokens.</p>\n</blockquote>",
      "rawMarkdown": "Congratulations and thank you for sharing your solution! It was very interesting to read.\n\nI have two questions.\n\n1. Are the prompt and output formats different between training and inference for the reranker? I understood it as predicting Yes/No for a single misconception during training, and rearranging multiple misconceptions during inference. Is that correct?\n\n2. I didn’t quite understand the part where the special token is assigned a weight of 100. Could you explain that in a bit more detail?\n\n> We implemented the reranker using logits_processors and logprobs by assigning a weight of +100 to specific tokens.\n",
      "votes": 1,
      "replies": [
        {
          "id": 3072332,
          "postDate": "2024-12-15T03:36:58.233Z",
          "content": "<p>Thank you for your question.</p>\n<p>The training and inference processes are consistent, both involving options like A, B, C, D …</p>\n<p>Regarding the weight of the special token: for these options (A, B, C, D,…), we apply a logit_bias of +100 to ensure that the model prioritizes these letters as output.    (set <code>scores[self.allowed_ids] += 100</code> in logitprocessor's <strong>call</strong>)</p>",
          "rawMarkdown": "Thank you for your question.\n\nThe training and inference processes are consistent, both involving options like A, B, C, D ...\n\nRegarding the weight of the special token: for these options (A, B, C, D,...), we apply a logit_bias of +100 to ensure that the model prioritizes these letters as output.    (set `scores[self.allowed_ids] += 100` in logitprocessor's __call__)\n",
          "votes": 3,
          "replies": [
            {
              "id": 3072403,
              "postDate": "2024-12-15T06:10:51.583Z",
              "content": "<p>I see that we can control the weight with logitsprocessor. I did not know that, thank you!</p>",
              "rawMarkdown": "I see that we can control the weight with logitsprocessor. I did not know that, thank you!"
            }
          ]
        }
      ]
    },
    {
      "id": 3072392,
      "postDate": "2024-12-15T05:33:15.227Z",
      "content": "<p>Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.</p>",
      "rawMarkdown": "Congratulations on your prize gold! I am glad to hear that my past solutions were helpful.\n\n"
    },
    {
      "id": 3072099,
      "postDate": "2024-12-14T17:26:21.777Z",
      "content": "<blockquote>\n  <p>\"We found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on NeurlPS 2022. The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv.\"</p>\n</blockquote>\n<p>That's cool! Have you analyzed how much improvement the parent subject information brings to the model's performance?</p>",
      "rawMarkdown": "> \"We found a useful subject_metadata.csv of which the SubjectId and SubjectName are Identical to this competition from the past eedi competition hosted on NeurlPS 2022. The subject_metadata.csv contains the parent subject, so we made a vector db with this metadata to add the parent subject information to both train.csv and test.csv.\"\n\nThat's cool! Have you analyzed how much improvement the parent subject information brings to the model's performance?",
      "replies": [
        {
          "id": 3072350,
          "postDate": "2024-12-15T04:10:21.173Z",
          "content": "<p>Not sure enough because I collected external data at the start of the competition. Personally I think the gain is marginal because our 14B and 32B retriever did not use this information. However, the parent subject is used as input of Chain-of-thought, Rerank and synthetic data generation, which may give the model some additional context.</p>",
          "rawMarkdown": "Not sure enough because I collected external data at the start of the competition. Personally I think the gain is marginal because our 14B and 32B retriever did not use this information. However, the parent subject is used as input of Chain-of-thought, Rerank and synthetic data generation, which may give the model some additional context.",
          "votes": 3
        },
        {
          "id": 3072353,
          "postDate": "2024-12-15T04:16:05.690Z",
          "content": "<p>By the way, I saw that you are an double degree exchange student in waseda. I am also an alumini of waseda's double degree program!!<br>\nI majored political science and economics in waseda with scholarship from BaiXian, are you in the same program?</p>",
          "rawMarkdown": "By the way, I saw that you are an double degree exchange student in waseda. I am also an alumini of waseda's double degree program!!\nI majored political science and economics in waseda with scholarship from BaiXian, are you in the same program?",
          "replies": [
            {
              "id": 3072724,
              "postDate": "2024-12-15T15:36:32.737Z",
              "content": "<p>Thank you for your response!<br>\nAnd it's great to meet you, senpai! But I'm actually in a different program - the double degree partnership between National Taiwan University and Waseda.<br>\nAlso, congratulations! You'll become a Grandmaster after this competition, right? ✨</p>",
              "rawMarkdown": "Thank you for your response!\nAnd it's great to meet you, senpai! But I'm actually in a different program - the double degree partnership between National Taiwan University and Waseda.\nAlso, congratulations! You'll become a Grandmaster after this competition, right? ✨"
            },
            {
              "id": 3072764,
              "postDate": "2024-12-15T16:12:29.227Z",
              "content": "<p>Oh, really! There were students from various countries(including Taiwan) in my program, so I thought maybe you are in the same one as mine.</p>\n<p>Congratulations to you too. It's amazing to see the magic of multiplying the unseen logits, which made our team feel stomachache in the final days…<br>\nYes! waiting for the finalize and become Grandmaster😆 And you will become a Master with solo gold!</p>",
              "rawMarkdown": "Oh, really! There were students from various countries(including Taiwan) in my program, so I thought maybe you are in the same one as mine.\n\nCongratulations to you too. It's amazing to see the magic of multiplying the unseen logits, which made our team feel stomachache in the final days...\nYes! waiting for the finalize and become Grandmaster😆 And you will become a Master with solo gold!"
            }
          ]
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T03:47:24Z",
  "competition_id": 82695,
  "competition_slug": "eedi-mining-misconceptions-in-mathematics",
  "team_id": 12624966,
  "solution_url": "/competitions/eedi-mining-misconceptions-in-mathematics/writeups/cqyr-2nd-place-solution"
}