-
Notifications
You must be signed in to change notification settings - Fork 864
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
[feat] add EvolInstruct
alike methods to camel/datagen
#1747
base: master
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
# simulate random scores in range (1, 10) for now | ||
scores = [random.randint(1, 10) for _ in batch_results[1:]] if keep_original else [random.randint(1, 10) for _ in batch_results] | ||
else: | ||
# TODO: implement instruction scoring module, e.g., complexity/quality scorer or by reward advantage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a future feature on scorer
which evaluates instructions, that can be rule-based or by a generative agent. some references:
- https://arxiv.org/pdf/2312.15685 using instruction complexity (by llm judge) as the score
- https://arxiv.org/pdf/2411.00062 using reward advantage as the score
- other metric for data selection/sampling: perplexities, reward variance, ...
IN_BREADTH_KEYS = ['persona', 'shift-in', 'shift-out', 'mix', 'abstract'] | ||
IN_DEPTH_KEYS = ['constraints', 'deepening', 'concretizing', 'reasoning', 'expansion'] | ||
|
||
EVOL_METHODS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notes: we can define more domain-specific templates (e.g., for math/coding/...).
also, currently the evolving happens independently for each prompt (x' ~ LLM( | x, ins)
); we should improve this later so that the evolving becomes multi-prompt / group based (x' ~ LLM( | a cluster of x, ins)
), where the LLM can crossover and mutate in a group.
regarding the prompt groups -- some time ago, @lightaime mentioned message-passing based sampling. we can also include support for this in our pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks for your work @ZIYU-DEEP ,but some docstring need to be polished
self, | ||
agent: ChatAgent, | ||
): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" | |
r""" |
Description
Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).
Fixes #1737. Changes made in:
./examples/datagen/evol_instruct
./camel/datagen/evol_instruct
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.Fixes #issue-number
in the PR description (required)pyproject.toml
andpoetry.lock
Notes for Reviewers
The current data handling of
EvolInstruct
andSelfInstruct
differs and could be improved. Let's discuss how to better align them with a base class?