Skip to content

feat: graphwalks token filter#115

Merged
AarushSah merged 11 commits intogroq:mainfrom
nmayorga7:feat/graphwalks-token-filter
Aug 31, 2025
Merged

feat: graphwalks token filter#115
AarushSah merged 11 commits intogroq:mainfrom
nmayorga7:feat/graphwalks-token-filter

Conversation

@nmayorga7
Copy link
Collaborator

@nmayorga7 nmayorga7 commented Aug 20, 2025

Summary

Adds optional token-count–based filtering to the GraphWalks dataset pipeline.
Samples that exceed user-specified max_context_size are now dropped during dataset preparation, constraining evals to contexts within a token budget.

What are you adding?

  • Bug fix (non-breaking change which fixes an issue)
  • New benchmark/evaluation
  • New model provider
  • CLI enhancement
  • Performance improvement
  • Documentation update
  • API/SDK feature
  • Integration (CI/CD, tools)
  • Export/import functionality
  • Code refactoring
  • Breaking change
  • Other

Changes Made

  • Extended record_to_sample in graphwalks.py to:
    • Compute input token counts via get_token_count.
    • Drop records whose token length exceeds max_context_size.
    • Attach raw_input_tok_cnt to sample metadata for downstream metrics
  • Updated get_dataset to accept max_context_size and pass it through to the mapper.

Testing

  • Ran evaluation with and without -T max_context_size
  • I have run the existing test suite (pytest)
  • I have added tests for my changes
  • I have tested with multiple model providers (if applicable)
  • I have run pre-commit hooks (pre-commit run --all-files)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Context

This feature mirrors the MRCR evaluation’s token gating strategy, but is adapted for GraphWalks.
It provides a consistent mechanism for controlling dataset size relative to model context limits, and sets up future work on token-binned scoring.

@nmayorga7 nmayorga7 marked this pull request as ready for review August 20, 2025 22:04
@nmayorga7 nmayorga7 requested a review from AarushSah as a code owner August 20, 2025 22:04
@nmayorga7 nmayorga7 changed the title Feat/graphwalks token filter feat: graphwalks token filter Aug 20, 2025
@AarushSah
Copy link
Contributor

@claude please review

@claude
Copy link

claude bot commented Aug 21, 2025

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

Copy link
Contributor

@AarushSah AarushSah left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Left some comments.

@nmayorga7 nmayorga7 marked this pull request as draft August 23, 2025 02:23
@nmayorga7 nmayorga7 marked this pull request as ready for review August 23, 2025 03:19
@nmayorga7
Copy link
Collaborator Author

Thanks for comments :)
See changes in latest commit:
fix: simplify tokenization, binning, and scoring logic

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@AarushSah AarushSah merged commit e38658c into groq:main Aug 31, 2025
14 of 15 checks passed
@github-actions github-actions bot mentioned this pull request Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants