Skip to content

fix: HED prompt asks for one validated annotation per event - #600

Merged
neuromechanist merged 3 commits into
OpenScience-Collective:developfrom
bendichter:fix/hed-prompt-one-example-per-event
Oct 8, 2026
Merged

neuromechanist merged 3 commits into
OpenScience-Collective:developfrom
bendichter:fix/hed-prompt-one-example-per-event

Conversation

@bendichter

@bendichter bendichter commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Refs #596 (its first point; the reasoning effort and step limit points are not in this change).

Summary

HED's prompt says "show ONE clear example, not multiple variations" and caps a reply at 200 to 300 words. GPT-6 Luna follows both literally: asked to annotate a task with a stimulus, a delay and a response, it validates all three and shows only the stimulus annotation. Sonnet and Haiku show three, which is the more useful answer and against the rule.

This changes those two lines:

  • The word limit applies to prose; annotation examples do not count toward it.
  • A task with several distinct events gets one validated annotation per event. Several variations of the same event are still ruled out.

Tests

Three conversations per row on the second message of the conversation in #596, local develop through OpenRouter (openai/gpt-6-luna):

Luna variant Annotations shown Prose words
high effort, current prompt 1, 1 (one run out of steps) 214, 248
medium effort, current prompt 1, 1, 1 211 to 267
high effort, this prompt 4, 3 (one run failed at the provider) 192, 179
medium effort, this prompt 3, 3, 3 233 to 244
  • osa validate src/assistants/hed/config.yaml passes.
  • pytest tests/test_assistants/test_community_yaml_generic.py -k hed: 20 passed.
  • pytest tests/test_agents/test_hed.py -m "not network": 16 passed.
  • Not measured on Haiku 4.5, HED's default on develop, or on Sonnet. Both already show several annotations under the current prompt, so I expect little change, but I have not run them with this one.
  • Longer answers cost more validation calls: at high effort Luna made 24 and 29 validate_hed_string calls in the two runs with this prompt (6, 9 and 6 without it). HED on GPT-6 Luna: the prompt asks for one example, medium effort is faster, and the 25-step limit ends the runs that fail #596 has the details.

Review follow-up

c26da01 tightens the two lines after review:

  • At most four kinds of events get an annotation; an event that repeats gets one, and the rest are offered as a follow-up.
  • The 400-word cap applies to prose. Code blocks that hold a HED annotation string do not count toward either figure; sidecar JSON and events.tsv are not annotation examples.
  • The example is "a stimulus onset and a response", and the internal tool-use example builds one string per event and validates each.

Additional tests:

  • osa validate src/assistants/hed/config.yaml; HED YAML tests (19 passed, 1 skipped); test_hed.py -m "not network" (16 passed).
  • 4f1fa5e replaces Flash and Button in the prompt's tool-use example, which HED 8.4.0 does not define. hed-suggest does return both (checked against the pinned build), so the example now says some suggestions are not HED tags and builds its strings from tags that validate on hedtools.org.

Not covered:

  • The table above is for the first version of the two lines. The follow-up wording has not been measured on Luna, and neither version on Haiku 4.5 (HED's default): the Bedrock account has no Anthropic use-case form on file, so Claude models could not be called from the test environment.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Cap at four kinds of events, one annotation for a repeated event, count the
400-word limit in prose only, and show one string per event in the internal
example. Validated with osa validate and the HED tests; not yet measured.
Flash and Button are suggested by hed-suggest but are not in the schema; the
example now builds its strings from tags that validate (checked with the
hedtools.org validator) and says some suggestions are not HED tags.
@neuromechanist
neuromechanist merged commit dabb63d into OpenScience-Collective:develop Oct 8, 2026
10 checks passed
neuromechanist pushed a commit that referenced this pull request Oct 10, 2026
Retitles [Unreleased] to [0.8.18], as for earlier releases. Adds the entries
that were missing for #599 (hed-suggest in the image), #600 (HED prompt),
#601 (widget host styles) and #605 (live tests by hand), and one for the
DEFAULT_MODEL check at startup. Names the three classes that are accepted
(the other five are refused), and fixes a reference that pointed the wrong way.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019MtQNfPzMpGxEJFUciXbTN
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.

3 participants