Skip to content

Synthetic Dataset: Support setting a shared prompt prefix. #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sjmonson
Copy link
Collaborator

Added support for a prefix_tokens argument which allows for generating a dataset where every prompt contains a shared prefix of length prefix_tokens.

Closes #104

@sjmonson sjmonson requested review from markurtz and Copilot June 10, 2025 19:39
Copilot

This comment was marked as outdated.

@sjmonson sjmonson requested a review from Copilot June 10, 2025 19:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for a shared prompt prefix by introducing a new configuration option (prefix_tokens) and modifying prompt generation in the synthetic dataset.

  • Introduces a new field (prefix_tokens) in the dataset configuration.
  • Generates and prepends a shared prefix to each prompt, updating token count calculations accordingly.
Comments suppressed due to low confidence (1)

src/guidellm/dataset/synthetic.py:191

  • The function name '_create_prompt' suggests that it returns a prompt string, but it now returns a list of token IDs. Consider renaming it (e.g., '_create_prompt_tokens') or updating its documentation to clarify the returned type.
def _create_prompt(self, prompt_tokens: int, start_index: int) -> list[int]:

@dagrayvid dagrayvid changed the title Sythetic Dataset: Support setting a shared prompt prefix. Synthetic Dataset: Support setting a shared prompt prefix. Jun 11, 2025
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.

[Feature Request] Testing with defined prefix lengths
2 participants