• 0 Posts
  • 17 Comments
Joined 3 years ago
cake
Cake day: October 27th, 2023

help-circle



  • Yep, basically like taking a few samples from a dataset and turning them into a short text “document” with an obvious pattern so the LLM will complete it

    Few-shot vs fine-tuning comparison:

    Pros:

    • converge behavior with much fewer examples
    • dynamic. changes to “dataset” applied without modifying model weights
    • no worry about whether important information is lost
    • can do things like average logits of single-token classification problems from multiple inferences (work around context length limitations)

    Cons:

    • needs context length, so can’t provide too many examples or too large
    • sometimes need “adversarial” examples to discourage repetition of text from other examples
    • models that are too small have worse ICL

  • phree_radical@alien.topBtoLocalLLaMA•Safety checks in Llama 2
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 years ago

    Looks like you’ve now made some changes. Columns now read “Llama2-7b-chat” instead of “llama2.” Also, chat responses below the completions, chastising the inappropriate messages. However, a completion was generated, first, and the item is still marked as “fail.” Very poor show






  • What you’re referring to as “prompt engineering” is more accurately described as how to get good interpolations between ChatGPT behaviors. Those are specific instructions and behaviors that OpenAI trains their models on, in careful proportion designed to reach good generalization on them

    And it’s not that the models are too small – Mistral 13b will be better than gpt-3.5-turbo. It’s all about the training

    Anyways that’s why I try to loudly proclaim the benefits of few-shot examples and completion instead of instruction, until we have models trained the way OpenAI’s are. If you’re willing to write examples and dodge the chatbot trained behaviors, you can pretty much perform any task without need for training




  • I dipped my toes in while comparing different methods of running Whisper on Android, and learned that they don’t intend developers to use NNAPI directly, but instead use a solution like TensorFlow Lite or PyTorch Mobile, which detects support and implements delegates which it may decide to use depending on the most efficient scenario. A developer needs to convert/“optimize” a model so that it doesn’t use any unsupported operations, but there’s also size considerations, like the TPU and other areas probably don’t have that much memory just yet



  • Interestingly, Mistral Instruct:

    As an AI
    
    ### top_k:
    
    0.686088: 13892 "assistant"
    0.049313: 28725 ","
    0.039010:  3842 "language"
    0.037810:  2229 "model"
    0.031591: 28733 "-"
    0.018000:  3332 "research"
    0.016518:  1587 "system"
    0.009266: 21631 "Assistant"
    0.006967:  7583 "expert"
    0.005598:  3921 "tool"
    0.004394:  8073 "agent"
    0.004242:   369 "that"
    0.002696:   304 "and"
    0.002644:   297 "in"
    0.001415:  5716 "student"
    0.001410:  5514 "technology"
    0.001197:  7786 "coach"
    0.001073:  1918 "team"
    0.001073: 24480 "scientist"
    0.001052:  2818 "based"
    0.001036:  2007 "program"
    0.000925: 12435 "bot"
    0.000819:  5181 "platform"
    0.000819: 28723 "."
    0.000816: 21782 "developer"
    0.000813:  6031 "assist"
    0.000806:  3327 "personal"
    0.000803:  9464 "algorithm"
    0.000776:  2488 "project"
    0.000746:   354 "for"
    0.000743:  8626 "teacher"
    0.000666:  7511 "eth"
    0.000645:  6953 "writer"
    0.000640: 24989 "practition"
    0.000623:  3441 "voice"
    0.000621:  5024 "professional"
    0.000611: 22275 "analyst"
    0.000588: 15589 "Language"
    0.000583:  8252 "virtual"
    0.000531:  7153 "digital"
    0.000525:   298 "to"
    0.000523: 11108 "technique"
    0.000523: 10706 "chat"
    0.000521: 19899 "specialist"
    0.000517:  8311 "tut"
    0.000501:  1338 "person"
    0.000493:  6878 "experiment"
    0.000474:   325 "("
    0.000460: 18112 "engineer"
    0.000458:  4993 "application"
    

  • Maybe it’s overkill, idk, but if you want higher accuracy, it’s an option

    You can just list examples from your dataset and let the LLM complete the last one

    Example:

    # Classify text
    
    (a) advertisement
    (b) poetry
    (c) information
    
    Ignore real-time Al and customers will do the same to you. Our vector database is AI-ready and proven at scale.
    Class: (a)
    
    I find no peace, and all my war is done. I fear and hope. I burn and freeze like ice. I fly above the wind, yet can I not arise
    Class: (b)
    
    YOUR BEST COMES OUT OF THE BLUE. EXPLORE BOISE STATE
    Class: (a)
    
    Two-month ramp closure: northbound OR 99W onto OR 217 north Starts May 31 of Transportation Oregon Department OR 217 AUXILIARY LANES
    Class: (c)
    
    Staying healthy. Staying active. We have it all right here. IN YOUR PRIME LEARN MORE LIVING YOUR BEST LIFE
    Class: (a)
    
    Go further, FASTER. Take the world's premier English- proficiency test in less than 2 hours!
    Class: (a)
    
    A rhinoceros beetle is a living thing. Rhinoceros beetles grow and respond to their environment. They need food and water.
    Class: (c)
    
    Our vice runs beyond all that old men saw, And far authentically above our laws, And scorning virtues safe and golden mean, Sits uncontrolled upon the high extreme.
    Class: (b)
    
    {your text here}
    Class: ({generate one token}
    

    I don’t know about the task you have in mind specifically, but you can do just about anything with a 13B llama model. Picking a fine-tune doesn’t matter if you use examples instead of instructions. 7B Mistral seems to do fine with this example (even GPT2 can do some classification), but in-context learning is remarkably better at 13B, picking up a lot more nuance