To understand why the current score (0.1090) is low compared to top teams (0.37+), we need to analyze specific failure points.
- Goal: Establish a local baseline using
train.csv(train_solution.csv). - Action: Run
python main.py --mode trainwith currentconfig.pysettings. - Metrics: Precision, Recall, F1, IoU distribution.
We will analyze the pipeline in three stages:
-
Retrieval Phase (Recall Analysis)
- Hypothesis: Relevant segments are not being retrieved in the Top-K.
- Experiment: Check if Ground Truth (GT) segments are present in the
top_k_candidatesbefore LLM filtering. - Metric: Recall @ K (before LLM).
-
LLM Filtering Phase (Precision/Recall Trade-off)
- Hypothesis: LLM
confidence_threshold(7) is too high, rejecting correct matches (False Negatives), or prompt is not specific enough. - Experiment:
- Compare "LLM Score < 7" items against GT to see how many valid matches were rejected.
- Compare "LLM Score >= 7" items against GT to see False Positives.
- Hypothesis: LLM
-
Bounding Box Merging (IoU Analysis)
- Hypothesis: BBoxes are too fragmented or too large, leading to low IoU even if the text match is correct.
- Experiment: Analyze IoU distribution for "Code Correct" predictions. If many are < 0.5, the merge logic needs tuning.
Based on the analysis, we will execute the following improvements.
Run experiments on train.json varying:
retrieval.score_threshold: [0.5, 0.55, 0.6]llm.confidence_threshold: [6, 7, 8]bbox.max_merged_ratio: [0.3, 0.5, 0.7]
Use widely different configurations to capture different signals, then merge them.
- Model A (High Recall): Low retrieval threshold, Low LLM threshold.
- Model B (High Precision): High retrieval threshold, High LLM threshold.
- Fusion: Union of A and B, or Majority Vote.
- Optimize the system prompt to include "Negative Constraints" (what is not a match) to reduce False Positives.
- Add specific "Few-Shot" examples if possible.
To enable iteration, we will create a dedicated experiment runner script.
This script will:
- Accept a list of configurations.
- Iteratively update
config.py(or pass args). - Run
main.py --mode train. - Parse the output logs for F1, Precision, Recall.
- Save a summary report
experiment_results.csv.
- Primary: F1 Score > 0.4 on Local Train Set.
- Secondary: F1 Score > 0.4 on Leaderboard (Test Set).
- Baseline: Run
main.py --mode trainand record F1. - Debug: Inspect logs for "LLM BLOCKED" or "Matches found but low score".
- Optimize: Run
run_experiments.pywith parameter grid. - Ensemble: Create a script
merge_submissions.pyto combine best results.