Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ZIYU-DEEP
Copy link
Contributor

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.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and poetry.lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

Notes for Reviewers

The current data handling of EvolInstruct and SelfInstruct differs and could be improved. Let's discuss how to better align them with a base class?

Copy link

Check out this pull request on  ReviewNB

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
Copy link
Contributor Author

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:

IN_BREADTH_KEYS = ['persona', 'shift-in', 'shift-out', 'mix', 'abstract']
IN_DEPTH_KEYS = ['constraints', 'deepening', 'concretizing', 'reasoning', 'expansion']

EVOL_METHODS = {
Copy link
Contributor Author

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.

Copy link
Collaborator

@zjrwtx zjrwtx left a 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,
):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""
r"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add EvolInstruct methods to camel/datagen
3 participants