axolotl-ai-cloud / axolotl

Go ahead and axolotl questions
https://axolotl-ai-cloud.github.io/axolotl/
Apache License 2.0
7.56k stars 820 forks source link

Add prediction (table) artifacts to Weights & Biases logger #490

Closed Glavin001 closed 1 year ago

Glavin001 commented 1 year ago

⚠️ Please check that this feature request hasn't been suggested before.

🔖 Feature description

One of my favourite features from LLM Studio is the validation prediction insights: https://h2oai.github.io/h2o-llmstudio/guide/experiments/view-an-experiment#experiment-tabs

Validation prediction insights : This tab displays model predictions for random, best, and worst validation samples. This tab becomes available after the first validation run and allows you to evaluate how well your model generalizes to new data.

image

image

Since Axolotl is headless (no UI) this can instead be implemented with WandB logging.

Examples:

✔️ Solution

See https://wandb.ai/stacey/mnist-viz/reports/Visualize-Predictions-over-Time--Vmlldzo1OTQxMTk

❓ Alternatives

No response

📝 Additional Context

I'd be interested in contributing this, if Axolotl team is interested and I can figure it out 😅

Acknowledgements

NanoCode012 commented 1 year ago

A callback could be added for this feature.

~I wasn’t sure wandb support saving text results.~

Edit: Wandb table can save predictions.

Glavin001 commented 1 year ago

@NanoCode012 : Could you give me some pointers on where this should be added to Axolotl? I'll try to find time in the next week when I'm training to add and test this new feature. Thanks!

NanoCode012 commented 1 year ago

callbacks should be placed in utils/callbacks.py. Then you can add it to the Trainer at utils/trainer.py. You can see examples of callbacks and how it's added in the aforementioned files.

I think you can add a callback on_evaluate finished (?) if that's an option to also predict over a few eval samples and save the responses.