Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using LIT to analyze Gemma Models in Keras (By:...

Using LIT to analyze Gemma Models in Keras (By: Syeda Maria Hussain) - DevFest Lahore 2024

Talk by Syeda Maria Hussain (https://www.linkedin.com/in/syeda-maria-hussain-a69a1aa5/) at DevFest Lahore 2024 by GDG Lahore.

GDG Lahore

December 15, 2024
Tweet

More Decks by GDG Lahore

Other Decks in Programming

Transcript

  1. Challenge • Large Language Models (LLMs) are powerful, but their

    behavior is heavily influenced by the input prompts. • Crafting effective prompts can be challenging and time-consuming, often requiring trial-and-error. • Understanding why a prompt works or doesn't work is crucial for improvement.
  2. Input Salience Methods: • Gradient Based: These methods analyze how

    small changes to the input affect the model's output. • Attention Scores: Attention scores can be interpreted as a measure of how much the model is "paying attention" to each word or phrase.
  3. Model Loading ! pip install -q -U "tensorflow==2.17" "keras >=

    3.0, <4.0" "keras-nlp >= 0.14" "lit-nlp >= 1.2" lit_widget = lit_pdbnb.make_notebook_widget( ['sample_prompts'], ["gemma_2b_it:gemma_1.1_instruct _2b_en"], dl_framework="kerasnlp", dl_runtime="tensorflow", batch_size=1, max_examples=5, precision="bfloat16", ) lit_widget.render() Parameters: - datasets_config - models_config - dl_framework - dl_runtime
  4. Q/A