Skip to content

chore: add more baselines (ModernBERT, CodeSage) and CodeNet fixes - #58

Merged
EYH0602 merged 6 commits into
mainfrom
chore/more-baselines
Feb 28, 2026
Merged

chore: add more baselines (ModernBERT, CodeSage) and CodeNet fixes#58
EYH0602 merged 6 commits into
mainfrom
chore/more-baselines

Conversation

@EYH0602

@EYH0602 EYH0602 commented Feb 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Add vanilla ModernBERT-base as a downstream baseline
  • Add CodeSage-small as a downstream baseline with per-task launcher scripts
  • Fix CodeNet download URL after IBM DAX CDN retirement
  • Fix ouput_file_path typo in CodeNet dataset scripts
  • Patch Conv1D import for CodeSage compatibility with transformers >=4.45

Test plan

  • Verify ModernBERT baseline scripts run correctly
  • Verify CodeSage baseline scripts run correctly
  • Confirm CodeNet download URL is valid

EYH0602 and others added 6 commits February 28, 2026 11:20
Register codesage/codesage-small (130M params) for code classification
and clone detection tasks. CodeSage uses a custom HuggingFace
architecture requiring trust_remote_code, and its StarCoder-based
tokenizer needs cls/sep/pad token fallbacks. Clone detection uses mean
pooling (same as ModernBERT).
Conv1D was moved from transformers.modeling_utils to
transformers.pytorch_utils. CodeSage's remote model code still imports
from the old location, causing an ImportError. Add a monkey-patch in
all downstream run.py files to restore the symbol before model loading.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f42687c12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export CUDA_VISIBLE_DEVICES="$CUDA_DEVICE"

cd "$ROOT_DIR/downstream/Clone-detection-BigCloneBench"
./run.sh answerdotai/ModernBERT-base "$ROOT_DIR/results/modernbert/Clone-detection-BigCloneBench"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass ModernBERT settings in BigCloneBench launcher

This launcher only passes <model_path> <output_dir>, but downstream/Clone-detection-BigCloneBench/run.sh hard-codes --model_type=roberta and --tokenizer_name=roberta-base when invoking code/run.py. When users run this *_modernbert.sh script, they are not actually evaluating a ModernBERT setup (and may get bad/incompatible weight loading), which can invalidate baseline results for this task.

Useful? React with 👍 / 👎.

export CUDA_VISIBLE_DEVICES="$CUDA_DEVICE"

cd "$ROOT_DIR/downstream/Defect-detection"
./run.sh answerdotai/ModernBERT-base "$ROOT_DIR/results/modernbert/Defect-detection"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward model type/tokenizer in Defect ModernBERT script

defect_modernbert.sh calls downstream/Defect-detection/run.sh with only two arguments, but that wrapper hard-codes --model_type=roberta and --tokenizer_name=roberta-base. As a result, this new script cannot run a true ModernBERT baseline and will either run with mismatched settings or fail during model load, breaking experiment validity for this launcher.

Useful? React with 👍 / 👎.

export CUDA_VISIBLE_DEVICES="$CUDA_DEVICE"

cd "$ROOT_DIR/downstream/Code-translation"
./run.sh answerdotai/ModernBERT-base "$ROOT_DIR/results/modernbert/Code-translation"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid using RoBERTa-only translation wrapper for ModernBERT

This script routes to downstream/Code-translation/run.sh, which is hard-coded to RoBERTa for both training and inference (--model_type roberta, --tokenizer_name roberta-base, and inference --model_name_or_path roberta-base). Running translation_modernbert.sh therefore does not evaluate ModernBERT and can produce misleading or failed runs for the advertised baseline.

Useful? React with 👍 / 👎.

@EYH0602
EYH0602 merged commit 733b855 into main Feb 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant