llm-competition-pipeline
Skill5 starsChanged 36 days agoMITView on GitHub
Use when: (1) Entering an LLM-based Kaggle competition (open-source model required, prompt engineering, few-shot), (2) Need to choose between base models (Qwen, DeepSeek, LLaMA), (3) Designing a prompt strategy (zero-shot, few-shot, chain-of-thought), (4) Deciding whether fine-tuning is worth the GPU cost vs prompt engineering alone, (5) Setting up closed-book inference (no RAG, no internet). Covers the full pipeline: base model selection → prompt engineering → few-shot curation → evaluation → (optional) SFT/PEFT → submission. Inspired by NVIDIA's nemotron-customize pipeline structure, adapted for Kaggle LLM competition constraints.
- Installs packages
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-validation-kaggleSkill
- agent-nurture-frameworkSkill
- agent-session-memory-protocolSkill
- arxiv-paper-searchSkill
- autogluon-firstSkill
- autogluon-preset-strategySkill
- autogluon-timeseries-strategySkill
- catboost-first-tabularSkill
- claudeceptionSkill
- code-competition-artifact-pipelineSkill
- competition-orchestration-multimodelSkill
- context-engineeringSkill
- controlled-submission-experimentSkill
- cross-competition-feature-transferSkill
- cv-lb-gap-acknowledgmentSkill
- domain-knowledge-constraints-trapSkill
- ensemble-model-correlation-trapSkill
- feature-engineering-saturation-detectionSkill
- gpu-readiness-assessmentSkill
- gsd-loop-engineeringSkill
- kaggle-cognitive-cost-optimizationSkill
- kaggle-competition-best-practicesSkill
- kaggle-competition-type-strategySkill
- kaggle-data-format-firstSkill
- kaggle-discussion-searchSkill
- kaggle-experiment-sopSkill
- kaggle-oof-lb-validation-protocolSkill
- kaggle-optimal-blendingSkill
- kaggle-submission-format-by-metricSkill
- kaggle-top-performer-replicationSkill
- knowledge-crystallization-feedback-loopSkill
- ladder-drift-and-meta-aware-regressionSkill
- learned-value-beats-heuristic-augmentationSkill
- mcts-pipeline-searchSkill
- mem0-dynamic-graph-memorySkill
- memory-hierarchy-managementSkill
- ml-sweet-spot-principleSkill
- model-ensemble-negative-weight-effectSkill
- multi-agent-rolesSkill
- multi-level-aggregation-overfittingSkill
- okf-visualize-knowledgeSkill
- onnx-minimal-network-designSkill
- per-category-modeling-backfireSkill
- progressive-verification-debuggingSkill
- ptcg-2ply-bounded-searchSkill
- ptcg-bc-large-model-submissionSkill
- retail-eda-frameworkSkill
- rmsle-zero-threshold-asymmetrySkill
- runtime-reflexionSkill
- sc-tir-mathematical-reasoningSkill
- self-evolving-skillsSkill
- skill-governance-and-automationSkill
- spatiotemporal-graph-feature-engineeringSkill
- store-sales-darts-chronos-blendSkill
- tabular-polynomial-features-breakthroughSkill
- three-layer-wisdom-extractionSkill
- time-series-walk-forward-validationSkill
- trueskill-simulation-competition-strategySkill
- ts-day-specific-forecastingSkill
- The first 60 shown.
The file
Files
LLM Competition Pipeline
Problem
LLM competitions (Industrial Automation, ARC-AGI-3, ai-agent-security) have unique constraints vs traditional ML:
- Open-source models only (Qwen, DeepSeek, LLaMA — no GPT/Claude)
- No internet at inference (all weights/data must be bundled)
- GPU time limited (30h/week shared, 9-12h per notebook run)
- Prompt engineering is 80% of the work (not model architecture)
- Closed-book setting (no RAG, no tools, no retrieval)
The Pipeline (6 Stages)
Stage 1: Base Model Selection
Choose based on competition rules + GPU memory:
| Model | Params | VRAM (FP8) | Speed | Use Case |
|-------|--------|-------------|-------|----------|
| Qwen 2.5-7B | 7B | ~8GB | Fast | MCQ, classification |
| Qwen 3.6-27B | 27B | ~28GB | Medium | Reasoning, ARC-AGI-3 |
| DeepSeek-R1 | 7B/14B | ~8-16GB | Fast | Math, logic |
| LLaMA-3.1-8B | 8B | ~8GB | Fast | General purpose |
Decision factors:
□ Competition rule: which model families are allowed?
□ VRAM budget: Kaggle T4 = 16GB, P100 = 16GB, dual T4 = 30GB
□ Inference time: 7B ~ 1-2s/query, 27B ~ 5-10s/query
□ Task type: reasoning → larger, classification → smallerStage 2: Prompt Engineering
Start simple, then add complexity:
Level 0 — Zero-shot:
"Answer the following question: {question}\nAnswer:"
Level 1 — Instruction:
"You are an expert in {domain}. Read the passage and answer.
Passage: {passage}
Question: {question}
Provide only the letter of the correct answer."
Level 2 — Few-shot (3-5 examples):
"Here are examples of correct answers:
Example 1: {input} → {output}
Example 2: {input} → {output}
Example 3: {input} → {output}
Now answer: {question}"
Level 3 — Chain-of-thought:
"Think step by step, then give the final answer."
Level 4 — Dynamic few-shot (retrieve relevant examples):
For each test question, retrieve the most similar training examples
and include them as few-shot context.Key rule: Each level adds latency. Level 0 is fastest. Only escalate if OOF accuracy improves by >2%.
Stage 3: Few-Shot Example Curation
Selecting the best few-shot examples:
Strategy A — Random (baseline):
Pick 3-5 random examples from training set.
Strategy B — Class-balanced:
Ensure examples cover all output classes equally.
Strategy C — Similarity-based (dynamic):
For each test question, compute embedding similarity to training questions.
Select top-K most similar as few-shot context.
This is the most effective but adds inference latency.
Strategy D — Hard negatives:
Include examples the model gets wrong (forces it to learn the distinction).
Validation: test each strategy on a held-out set. Pick the one with highest accuracy.Stage 4: Evaluation
Before submitting:
□ Local evaluation on training set (all examples)
□ Measure: accuracy, per-class F1, confusion matrix
□ Check: are failures concentrated in specific question types?
□ Check: is the model output format correct? (letter vs full text)
□ Check: latency per query × number of test queries < time limit
Common LLM evaluation traps:
- Model outputs "The answer is C" instead of just "C" → parsing fails
- Model refuses to answer (safety filter) → need to bypass
- Model hallucinates non-existent options → need option-list constraint
- Few-shot examples leak test answers → use disjoint train/test splitStage 5: Fine-Tuning (Optional, GPU-Intensive)
Only if prompt engineering plateaus AND rules allow fine-tuning:
Approach 1 — LoRA/PEFT (parameter-efficient):
GPU: 8-16GB for 7B model
Time: 2-4 hours for 1000 examples
Gain: +2-5% accuracy typical
Risk: overfit to training distribution
Approach 2 — Full SFT (supervised fine-tuning):
GPU: 40-80GB for 7B model (multi-GPU or A100)
Time: 4-8 hours
Gain: +5-10% accuracy
Risk: catastrophic forgetting
Approach 3 — RL alignment (DPO/GRPO):
GPU: same as SFT
Time: 4-8 hours additional
Gain: +1-3% over SFT
Risk: reward hacking
Decision: LoRA if GPU-limited, SFT if competitive, RL only if top 10%.Stage 6: Submission Packaging
For code competitions (no internet):
□ Model weights saved as Kaggle dataset
□ Tokenizer bundled
□ Inference script uses only offline dependencies
□ All imports available in Kaggle environment (pip install --no-index)
□ Notebook runs within time limit (test with small subset first)
□ Output format matches submission specification EXACTLY
Common failures:
- Internet disabled → pip install fails → bundle wheels as dataset
- Model too large → use quantization (FP8, INT4)
- Inference too slow → batch queries, use vLLMCompetition-Specific Strategies
MCQ/Knowledge Tasks (Industrial Automation T1)
- Base model: Qwen 2.5-7B (fast, good at knowledge)
- Prompt: few-shot with domain examples
- Key: FMEA knowledge base as system prompt (if rules allow)
- Pitfall: metadata leakage (old test set had metadata, new doesn't)
Agent/Interactive (ARC-AGI-3)
- Base model: Qwen 3.6-27B FP8 (strong reasoning)
- Architecture: Python REPL + segmentation tool + multimodal image
- Key: harness design > model choice (per Tufa Labs Duck writeup)
- GPU: mandatory (27B model, 96GB VRAM, 9h runtime)
Security/Red-Team (ai-agent-security)
- Base model: GPT-OSS or Gemma (competition-specified)
- Architecture: attack search algorithm + sandboxed agent interaction
- Key: search strategy (fuzzing, evolutionary, Go-Explore)
- GPU: needed for target model inference during development
Evidence
- Industrial Automation T1: FMEA knowledge base + parser (0.28 LB, metadata removed)
- ARC-AGI-3: Duck harness studied (1.21% LB winner, Qwen 3.6-27B + REPL)
- LLM benchmark: closed-book constraint means model internal knowledge is key
- Prompt engineering typically contributes 80% of score; fine-tuning adds 20%
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

