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

[Multi-hop RAG opt + improvement] [V0.3.0 Cycle Graph] #223

Merged
merged 26 commits into from
Dec 16, 2024
Merged

[Multi-hop RAG opt + improvement] [V0.3.0 Cycle Graph] #223

merged 26 commits into from
Dec 16, 2024

Conversation

liyin2015
Copy link
Member

@liyin2015 liyin2015 commented Sep 23, 2024

  • fix the api in the word count code and generate better diagnose report
  • multi-hop RAG will have cycles, we can create a copy to every node that is a cycle to unroll the DCG to DAG, but hard to do as we have to recreate the component such as Retriever or Generator. DsPY simply does not support cycle yet.

Design choice: (1) support cycle, we treat it as a component where its prompt has to be adapted to multiple sets of inputs and outputs, in practical this make sense (2) user not creating a cycle, they treating each repeating as a new copy node and has its own parameter.

For (2) its easy, everything works out of box, users just need to know that they are doing this intentional
for (1) we have to carefully design how the gradient works, and how the demo works (demo should aggregate both parts)

  • (2) User try not to create a cycle

Multi-hop retriever

no_cycle_multi_hop_retriever

Multi-hop RAG (works by simplify replace the retriever if we simplify follow the retriever api)

no_cycle_design_trace_graph_Generator_output_id_f5377eef-9f12-4e6e-b0e0-6546b20012fd

@liyin2015 liyin2015 changed the title [RAG + improvement] [Multi-hop RAG opt + improvement] Sep 24, 2024
@liyin2015 liyin2015 changed the title [Multi-hop RAG opt + improvement] [Multi-hop RAG opt + improvement] [V0.2.4 Cycle Graph] Sep 24, 2024
…api_kwargs for generator/retriever for debug in the parameter and to visualize in the graph in the parameter
Copy link

@sameeramin sameeramin left a comment

Choose a reason for hiding this comment

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

Hey @liyin2015, Is this PR ready to be reviewed?

@liyin2015
Copy link
Member Author

We can diagnose and trace all generator calls end to end as follows:

Screenshot 2024-10-26 at 8 54 21 PM

It can track two generators used in the retriever which is saved in ComponentList but as each file trace each call separately, we might want a single file that will have better visualization, especially fit it back to a graph.

…sively, add ScoreTrace as a structure to support multi_eval function
@liyin2015 liyin2015 changed the title [Multi-hop RAG opt + improvement] [V0.2.4 Cycle Graph] [Multi-hop RAG opt + improvement] [V0.3.0 Cycle Graph] Oct 27, 2024
… score is correct at the demo parameter, need to check demo optimizer
@liyin2015
Copy link
Member Author

Show data id (from the dataset) in the graph, and show the score for each traces in the demo paramter.

Screenshot 2024-10-27 at 6 59 43 PM
Screenshot 2024-10-27 at 6 59 31 PM

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@Sylph-AI Sylph-AI left a comment

Choose a reason for hiding this comment

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

TODO: write a better relase change log later

@Sylph-AI Sylph-AI merged commit 676638d into main Dec 16, 2024
4 checks passed
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