// Data for Farseen Shaikh portfolio

const PAPERS = [
  {
    id: "scar",
    title: "SCAR — Sparse Code Audit Retriever via SAE-LoRA Adaptation",
    year: 2026,
    venue: "ACL ARR 2026 (March)",
    venueShort: "ACL ARR '26",
    role: "Sole author",
    tags: ["SAE", "Retrieval", "Security", "LoRA"],
    tldr: "First security-native sparse latent retriever for smart contract auditing. Introduces SAE-LoRA to bridge SAE reconstruction features and retrieval-discriminative representations.",
    headline: "R@10 = 0.901 on 232k contracts (BM25: 0.308). 37.6× over frozen-SAE baseline.",
    problem: "Existing RAG auditing tools use generic dense embeddings or BM25. Both fail: audit findings describe vulnerabilities in natural language while vulnerable code uses Solidity-specific patterns. And SAE features trained for reconstruction are dominated by generic code tokens — whitespace, `uint`, `public` — because those minimize reconstruction loss, not retrieval utility.",
    method: [
      "Backbone: Qwen2.5-Coder-1.5B, 28 layers, hidden 1,536",
      "Domain-specific JumpReLU SAE, width 16,384 (10.7× expansion), trained on 231k contracts. L0=37, variance explained 0.97.",
      "SAE-LoRA: low-rank update to the SAE encoder — W_eff = W_e + AB, adding 4.6M parameters (~0.3% of backbone). Decoder, biases, thresholds remain frozen.",
      "Contrastive training on 7,552 human-auditor pairs from 231k contracts.",
      "Pipeline: hook L19 → SAE-LoRA encode → per-token TopK → sum-pool → IDF·TopK → L2-norm → 16k-dim sparse vector."
    ],
    results: [
      ["R@10, full 232k corpus", "0.901"],
      ["R@10, 838-pair eval", "0.977"],
      ["OOD EVMBench coverage", "75.6%"],
      ["Compactness vs vocab-sparse", "9.3× more compact"]
    ],
    matters: "SAE-LoRA is general. It bridges the gap between SAE reconstruction objectives and downstream task objectives. SCAR is the first instance; the approach applies to any task where pretrained SAE features need task-specific adaptation.",
    links: [{ label: "OpenReview", href: "https://openreview.net/profile?id=~Farseen_Shaikh1" }]
  },
  {
    id: "self-correct",
    title: "Can LLMs Self-Correct Table Reasoning Errors?",
    year: 2026,
    venue: "ACL 2026 Workshop SURGeLLM",
    venueShort: "ACL '26 Workshop",
    role: "Sole author",
    tags: ["LLM", "Self-correction", "Tables", "Evaluation"],
    tldr: "First systematic cross-model analysis of LLM self-correction for table reasoning. Proposes Structured Self-Correction (SSC) — a 4-check verification chain.",
    headline: "Accuracy-correction paradox extends to tables. Crossover ≈ 70% base accuracy. SSC cuts over-correction 38–75% on TabFact.",
    problem: "Self-correction has been studied for math and code but never for tables. Naive self-correction (\"is this correct?\") fails — models rubber-stamp their own answers. Table errors are distinct: grounding in semi-structured data, wrong cell retrieval, computation, logic, hallucinated values.",
    method: [
      "3-step protocol: initial answer with reasoning → error detection (naive or SSC) → correction if flagged.",
      "SSC's 4 checks: Cell Verification, Computation Check, Logic Check (negation/superlative/temporal), Completeness Check.",
      "Error taxonomy: Wrong Cell, Wrong Computation, Wrong Logic, Hallucination, Partial Answer.",
      "5 models from 5 providers: Gemini 3.1 Pro, Kimi K2.5, GLM 5, Qwen 3.5+, MiniMax M2.5.",
      "WikiTableQuestions + TabFact, 1,000 examples each."
    ],
    results: [
      ["Gain below 70% base acc.", "up to +3.4%"],
      ["Loss above 70% base acc.", "up to −1.7%"],
      ["Over-correction reduction (TabFact)", "38–75%"],
      ["Domain-transfer floor (FinQA)", "21.5%"]
    ],
    matters: "Table-Critic (ACL 2025) uses 4 specialized agents to achieve similar reductions. SSC reaches comparable results through structured prompting alone — a lightweight alternative with no multi-agent infrastructure.",
    links: []
  },
  {
    id: "cross-format",
    title: "Do Structured Data Comprehension Skills Transfer Across Representation Types?",
    year: 2026,
    venue: "ACL 2026 Workshop SURGeLLM",
    venueShort: "ACL '26 Workshop",
    role: "Sole author",
    tags: ["LLM", "Evaluation", "Multimodal", "Tables"],
    tldr: "First study measuring cross-format transfer across 5 fundamentally different structured-data representations using identical content and programmatic ground truth.",
    headline: "Strong transfer across text formats (r=0.85). Chart images are siloed — 20–50% accuracy gap vs equivalent text.",
    problem: "LLMs are evaluated on structured-data tasks through isolated benchmarks. Nobody has tested whether competence on tables transfers to graphs, time series, or charts. Is it a general skill, or format-specific?",
    method: [
      "1,724 programmatically generated questions over 250 sub-tables from 10 datasets, 7 domains.",
      "5 formats: Markdown table, Chart image (PNG), Chart text-description (length-matched ±20%), Entity-relationship graph (cosine edges), Unlabeled time series.",
      "7 question types: Lookup, Comparison, Aggregation, Trend, Extremum, Multi-hop, Conditional aggregation.",
      "6 frontier LLMs (March '26): DeepSeek V3.2, MiniMax M2.5, Kimi K2.5, GLM-5, Qwen 3.5+, Gemini 3.1 Pro.",
      "Primary metric: tetrachoric correlation on binary outcomes."
    ],
    results: [
      ["Table ↔ graph ↔ time series r", "0.85"],
      ["Chart-text weaker r", "0.65"],
      ["Chart image vs text gap (Kimi)", "31.9% vs 81.6%"],
      ["Format-independent failures", "0.3–4.6%"]
    ],
    matters: "Format-specific benchmarks for text-based structured data may be partially redundant. A well-designed table comprehension benchmark could proxy for graph and time-series comprehension. Chart images still need independent assessment.",
    links: []
  },
  {
    id: "sweeper",
    title: "SweeperLLM — Representation Over Training",
    year: 2026,
    venue: "arXiv (under review)",
    venueShort: "arXiv '26",
    role: "Sole author",
    tags: ["LLM Agents", "Representation", "RL", "SFT"],
    tldr: "Fine-tunes Qwen2.5-14B-Instruct to play Minesweeper and finds that board representation — not model capacity or training — is the dominant factor in agent validity.",
    headline: "Compact ASCII grid: 10–15% valid moves. Frontier constraint list: 100% valid moves across all board sizes, even without fine-tuning.",
    problem: "LLMs are trained on token sequences and have no mechanism to spatially index into a 2D grid. A 30×30 board has 900 cells; reliably identifying that cell (r,c) is adjacent to a revealed '2' requires spatial indexing LLMs aren't trained to do.",
    method: [
      "3-tier CSP solver for training data: single-cell propagation → coupled subset reduction → tank backtracking with Union-Find partitioning and log-Γ weighted probabilities.",
      "50,000 high-quality demonstrations via 32 parallel workers.",
      "SFT: Qwen2.5-14B-Instruct + LoRA (r=64, α=128), all projection layers, 1 epoch, lr 2e-5, Unsloth on AMD MI300X / ROCm.",
      "GRPO exploration with 3 reward functions — failed due to variance collapse."
    ],
    results: [
      ["Valid moves (ASCII)", "10–15%"],
      ["Valid moves (frontier list)", "100%"],
      ["Board sizes tested", "6×6 → 30×30"],
      ["Games evaluated", "85"]
    ],
    matters: "GRPO with strong SFT prior + 4 rollouts leads to within-group reward variance collapse, leaving the advantage estimator without signal. SFT alone outperformed SFT+GRPO. This is the broader lesson: how you represent state to an LLM matters more than how you train it.",
    links: [{ label: "Code", href: "https://github.com/FarseenSh/SweeperLLM" }]
  }
];

const PROJECTS = [
  {
    id: "papermind",
    name: "PaperMind AI",
    kicker: "Full-stack research-paper learning platform",
    year: 2026,
    tags: ["AWS", "FastAPI", "React", "RAG", "Agents"],
    tldr: "Ingests academic PDFs (arXiv, OpenReview, PMLR, uploads) and runs a 9-agent pipeline on AWS Bedrock to produce study materials, Mermaid diagrams, rendered LaTeX, RAG chat, and AI code generation from paper ideas.",
    stack: "React 19 · TypeScript · Vite 6 · Tailwind v4 · FastAPI · asyncpg · pgvector · AWS Bedrock · Cognito · RDS · S3 · Step Functions · DynamoDB · CloudFront",
    highlight: "9 agents across Bedrock: GLM-OCR, Kimi K2.5, GLM 4.7, Cohere Embed v4, DeepSeek V3.2, MiniMax M2.1.",
    links: [
      { label: "Live", href: "https://d2iqlx1elpeu3n.cloudfront.net/" },
      { label: "Code", href: "https://github.com/FarseenSh/PaperMind_AI" }
    ]
  },
  {
    id: "goat",
    name: "GOATsolana-MCP",
    kicker: "First MCP server connecting Claude with Solana",
    year: 2025,
    tags: ["MCP", "Solana", "TypeScript", "Agents"],
    tldr: "An MCP server that lets Claude access, analyze, and visualize Solana blockchain data through natural language. 18 tools across config, data, predictions, security, and visualization.",
    stack: "TypeScript · Node 18+ · ES modules · GOAT SDK · Anthropic MCP · BirdEye · CoinGecko · Allora · Helius",
    highlight: "18 tools · 8 chart types · read-only for security · 18★ / 5 forks.",
    links: [
      { label: "Code", href: "https://github.com/FarseenSh/GOATsolana-mcp" }
    ]
  }
];

const STATS = [
  { value: 4, suffix: "", label: "Papers", sub: "All sole-author" },
  { value: 0, suffix: "", label: "Co-authors", sub: "Across all 4 papers" },
  { value: 37.6, suffix: "×", label: "SAE-LoRA lift", sub: "over frozen baseline" },
  { value: 0.901, suffix: "", label: "SCAR R@10", sub: "on 232k contracts" },
  { value: 100, suffix: "%", label: "Valid moves", sub: "SweeperLLM, all sizes" },
  { value: 61, suffix: "", label: "Languages", sub: "Tiny Aya SAEs" }
];

const THROUGHLINE = [
  { year: "'24–'26", title: "Inside Tiny Aya", note: "Understanding SAE features — 4 SAEs on multilingual models." },
  { year: "'25–'26", title: "SCAR", note: "Adapting SAE features — invented SAE-LoRA to bridge reconstruction → retrieval." },
  { year: "'26", title: "SweeperLLM", note: "Representation engineering — how you encode state dominates training." },
  { year: "'26", title: "Self-Correction", note: "Decomposing LLM error patterns in structured data." },
  { year: "'26", title: "Cross-Format Transfer", note: "Do structured-data skills generalize across representations?" }
];

const TECH = {
  "Languages": ["Python", "TypeScript", "JavaScript", "Solidity", "SQL / PLpgSQL"],
  "ML / AI": ["PyTorch", "LoRA / PEFT", "SAELens", "Unsloth", "HuggingFace", "Cohere API", "AWS Bedrock"],
  "Models used": ["Kimi K2.5", "DeepSeek V3.2", "GLM 4.7", "MiniMax M2.1", "Cohere Embed v4", "Qwen 2.5 / 3.5"],
  "Web / Backend": ["React 19", "Vite 6", "FastAPI", "asyncpg", "pgvector", "Tailwind", "Framer Motion"],
  "Cloud / Infra": ["AWS Bedrock", "Cognito", "RDS", "S3", "Step Functions", "DynamoDB", "EventBridge", "EC2", "CloudFront", "AMD MI300X / ROCm"],
  "Methods": ["JumpReLU SAEs", "BatchTopK SAEs", "GRPO", "Contrastive Learning", "MCP", "GOAT SDK"]
};

const COHERE = {
  title: "Inside Tiny Aya",
  subtitle: "Cohere Labs · Expedition Tiny Aya 2026",
  role: "Team Captain",
  team: ["Farseen Shaikh (captain)", "Matthew Nguyen", "Tra My (Chiffon) Nguyen"],
  what: "Trained 4 Sparse Autoencoders on all four Tiny Aya regional variants to study how multilingual LLMs represent 70+ languages internally.",
  sae: [
    ["Architecture", "BatchTopK → JumpReLU for inference"],
    ["Input dim", "2,048"],
    ["SAE width", "16,384 (8× expansion)"],
    ["Active features", "k = 64 per token"],
    ["Hook point", "model.layers.28"],
    ["Training data", "~1M tokens / lang, 61 langs, ~41M total"]
  ],
  variants: [
    ["tiny-aya-global", "All 70+ languages"],
    ["tiny-aya-fire", "South Asian languages"],
    ["tiny-aya-earth", "African + West Asian"],
    ["tiny-aya-water", "Asia-Pacific + European"]
  ],
  links: [
    { label: "Code", href: "https://github.com/FarseenSh/Inside-Tiny-Aya" },
    { label: "Models (HF)", href: "https://huggingface.co/Farseen0/tiny-aya-saes" },
    { label: "CredsVerse", href: "https://credsverse.com/credentials/c9f5942d-4c1f-4bc9-8fe9-ac13f1448b3a" }
  ]
};

const WRITING = [
  { title: "Why representation is the bottleneck", note: "Draft — synthesizing SweeperLLM + SCAR + Tiny Aya into one argument.", status: "In progress" },
  { title: "SAE-LoRA in one diagram", note: "Short explainer with interactive feature-activation viz.", status: "Planned" },
  { title: "Notes on GRPO variance collapse", note: "Practitioner's field-note from the SweeperLLM experiments.", status: "Planned" }
];

Object.assign(window, { PAPERS, PROJECTS, STATS, THROUGHLINE, TECH, COHERE, WRITING });
