スキル一覧に戻る
TerryTong-Git

exps-logistic

by TerryTong-Git

Claude Code project configuration for ToolProj

0🍴 0📅 2026年1月14日
GitHubで見るManusで実行

SKILL.md


name: exps-logistic description: Documentation for the logistic regression MI estimation experiment (exps_logistic)

exps_logistic - Logistic Regression MI Estimation

Purpose

Measure mutual information (MI) lower bound between CoT rationales and problem parameters using multinomial logistic regression on embeddings. Compares code vs NL representations.

Key Files

FilePurpose
src/exps_logistic/main.pyMain experiment runner
src/exps_logistic/config.pyConfiguration, CLI args, kind presets
src/exps_logistic/data_utils.pyData loading, gamma label creation
src/exps_logistic/classifier.pyLogistic regression classifier
src/exps_logistic/featurizer.pyEmbedding extraction (BERT, TF-IDF)
src/exps_logistic/run.shDev script for single model
src/exps_logistic/prod_logistic.shProduction script for all models
src/exps_logistic/notebooks/generate_plots.pyPlot generation

Kind Presets (in config.py)

FG_KINDS = {"add", "sub", "mul", "lcs", "knap", "rod", "ilp_assign", "ilp_prod", "ilp_partition"}

CLRS_KINDS = {
    "activity_selector", "articulation_points", "bellman_ford", "bfs",
    "binary_search", "bridges", "bubble_sort", "dag_shortest_paths",
    "dfs", "dijkstra", "find_maximum_subarray_kadane", "floyd_warshall",
    "graham_scan", "heapsort", "insertion_sort", "jarvis_march",
    "kmp_matcher", "lcs_length", "matrix_chain_order", "minimum",
    "mst_kruskal", "mst_prim", "naive_string_matcher", "optimal_bst",
    "quickselect", "quicksort", "segments_intersect",
    "strongly_connected_components", "task_scheduling", "topological_sort",
}

NPHARD_KINDS = {"edp", "gcp", "ksp", "spp", "tsp"}

EXTENDED_KINDS = FG_KINDS | CLRS_KINDS | NPHARD_KINDS  # 44 total kinds

Gamma Labels

Format: {kind}|d{digits}|b{bin} (e.g., knap|d8|b24)

  • Fine-grained kinds have parsed bin values based on problem parameters
  • CLRS/NP-hard kinds get bNA (no fine-grained parsing)

CLI Arguments

ArgDescription
--results-dirPath to exps_performance results
--modelsModel filter (e.g., anthropic/claude-haiku-4.5)
--repRepresentation: code or nl
--labelLabel type: kind, theta_new, or gamma
--kinds-presetKind filter: fg, clrs, nphard, or extended
--featsFeaturizer: hf-cls, tfidf, st, openai
--embed-modelHuggingFace model for embeddings
--no-cvDisable cross-validation
--bitsReport cross-entropy in bits

Generated Plots (in src/exps_logistic/notebooks/)

PlotDescription
boxplot_extended.pngCode vs NL MI comparison
kde_extended.pngKDE density comparison
mi_vs_accuracy_extended.pngMI vs task accuracy correlation
contrast_extended.pngPer-model contrast (code - nl)
label_dist_by_kind.pngSample counts by problem kind
label_dist_by_digits.pngFine-grained distribution by digits
label_dist_heatmap.pngKind × Digits heatmap
label_dist_top30.pngTop 30 most frequent labels
label_dist_zipf.pngZipf-like frequency distribution
label_dist_pie.pngCategory breakdown pie chart

Key Results (Extended Kinds - Jan 9, 2026)

  • 28 successful runs across 6 models
  • Pearson r = 0.486, p = 0.009 (MI vs accuracy correlation)
  • 500 unique labels across 44 problem kinds
  • Code representation shows higher MI lower bounds than NL
  • Models tested: claude-haiku-4.5, gemini-2.5-flash, gpt-4o-mini, llama-3.1-405b-instruct, ministral-14b-2512, qwen-2.5-coder-32b-instruct

Running Commands

# Dev run (single model)
bash src/exps_logistic/run.sh

# Production run (all models, all seeds)
bash src/exps_logistic/prod_logistic.sh

# Generate plots
uv run --no-sync python src/exps_logistic/notebooks/generate_plots.py

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です