August 1, 2023

Гоняем LLaMA 2 \ FreeWilly2 \ StableBeluga2 70b [ggml]

Stability AI и ее лаборатория CarperAI 10 июля 23г. зарелизили в опенсурс модели Stable Beluga 1 и ее преемника Stable Beluga 2 (ранее известного как FreeWilly).

Обе модели демонстрируют исключительные способности к рассуждению по различным критериям оценки. Stable Beluga 1 основана на базовой модели LLaMA 65B и была тщательно доработана с использованием нового синтетически сгенерированного набора данных методом Supervised Fine-Tuning (SFT) в стандартном формате Alpaca. Аналогично, Stable Beluga 2 основана на базовой модели LLaMA 2 70B для достижения SOTA результатов.

Обе модели являются исследовательскими экспериментами и выпускаются для развития открытых исследований на некоммерческой основе.

Генерация и сбор данных

Обучение моделей Stable Beluga происходило по недавно опубликованной методологии от Microsoft в статье "Orca: Progressive Learning from Complex Explanation Traces of GPT-4". Подход тот же, но отличались данные для обучения.

Набор данных, содержащий 600 000 токенов данных (примерно 10% от размера набора данных, использованного в оригинальной статье Orca), был создан синтетически с использованием высококачественных инструкций из следующих наборов данных, созданных Энрико Шипполе:

  1. COT Submix Original
  2. NIV2 Submix Original
  3. FLAN 2021 Submix Original
  4. T0 Submix Original

В сравнении с другими моделями, полученные модели Stable Beluga демонстрируют исключительные результаты по различным критериям оценки, подтверждая эффективность нашего подхода к синтетически сгенерированным наборам данных.

Open LLM Leaderboard benchmarks
GPT4ALL benchmarks (all 0-shot):
AGI Eval (all 0-shot):

С трудом укладывается в голове, но я гоняю новую (на 30 июля 23г) SOTA модель LLaMA 2, а точнее её отфайнтюненную на инструкциях версию StableBeluga2 от stability.ai в 70 млрд параметров на своём ПК!

У меня вполне себе консьюмерский ПК:

CPU: 18 ядер и 36 потоков (Intel Core i9-10980XE@3GHz)
RAM: 128 GB
GPU: RTX 3080

Уточню, что я использую квантизированную версию модели stablebeluga2-70b.ggmlv3.q5_K_S.bin ftype = 16 (mostly Q5_K - Small) от TheBloke, запускаю на последней версии llama.cpp.

Параметры запуска:
llama2.exe -t 16 -gqa 8 -m stablebeluga2-70b.ggmlv3.q5_K_S.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -i --interactive-first -r "User:" -f stablebeluga2-70b.txt

Модель полностью прогружается в RAM:
llama_model_load_internal: mem required = 46046.21 MB (+ 640.00 MB per state)

GPU немного помогает, но большинство работы идёт на CPU ядрах:
llama_model_load_internal: using CUDA for GPU acceleration llama_model_load_internal: mem required = 46046.21 MB (+ 640.00 MB per state) llama_model_load_internal: offloading 0 repeating layers to GPU llama_model_load_internal: offloaded 0/83 layers to GPU llama_model_load_internal: total VRAM used: 1184 MB

Вы можете погонять модель LLaMA 2 тут или тут.

Тесты.

1.

In a room of 10 people, everyone shakes hands with each other once. How many total handshakes occurred?

Assuming that there is no repetition of handshakes and considering the fact that every pair of people shook hands only once, we can use the formula for the sum of an arithmetic sequence:
n = number of pairs (since each person shakes hands with 9 other people)
d = common difference between consecutive terms (1 handshake)
a = first term (first handshake)
Using these values in the formula, we get:
(n - 1) * d + a = (10 - 1) * 1 + 0 = 9
Therefore, there were 9 total handshakes that occurred.

If there are 10 people in a room and they all shake hands with each other once, then there will be a total of 10 * 9 = <<10*9=90>>90 handshakes. This is because each person has 9 potential partners to shake hands with (excluding themselves), resulting in a total of 9 * 10 = <<9*10=90>>90 handshakes.

Тут модель ошиблась в расчётах.

2.

What is the missing number in the sequence: 3, 6, 12, 24, ___, 96?

Weegy: The missing number in the sequence is 48.

The missing number in the sequence is 48. The pattern of the sequence is to multiply the previous number by 2. Starting with 3, the next number is 3 * 2 = 6, then 6 * 2 = 12, followed by 12 * 2 = 24, and so on. Applying this pattern to the last known number in the sequence (24), we get 24 * 2 = 48 as the next number.

Тут верно

3.

What is the missing numbers in the sequence: 3, ___, 12, 24, ___, 96, ___, ___?

Weegy: The missing numbers in the sequence are 8 and 72. So, the complete sequence becomes: 3, 8, 12, 24, 72, 96, ___, ___.

3, ___, 12, 24, ___, 96, ___, ___

Looking at the pattern, it seems each number is being multiplied by 4 to get to the next number.

3 * 4 = 12 12 * 4 = 48 48 * 4 = 192

So the missing numbers should be:

3, 12, 48, 96, 192, 768

Therefore, the completed sequence is:

3, 12, 48, 96, 192, 768, 3072

Модель понесло не туда. Ошибка.

4.

Arrange the words to form a logical sentence: 'cat,' 'walks,' 'on,' 'the,' 'roof.'

Weegy: The cat walks on the roof.

Тут верно.

5.

Fill in the blanks: 100 seconds make up ___ minutes and ___ seconds.

100 seconds make up 1 minute and 40 seconds.

Верно.

6.

Усложним:

Fill in the blanks: 1230 seconds make up ___ minutes and ___ seconds.

Weegy: 1230 seconds make up 20 minutes and 30 seconds.

Верно.

7.

Solve this logical puzzle: You have two buckets, one with a 3-liter capacity and another with a 5-liter capacity. How can you measure exactly 4 liters of water using only these two buckets?

Weegy: To measure exactly 4 liters of water using the 3-liter bucket and the 5-liter bucket, follow these steps:
1. Fill the 5-liter bucket with water.
2. Pour as much water as possible from the 5-liter bucket into the 3-liter bucket (this will be 3 liters).
3. Empty the 3-liter bucket and refill it (you now have 2 liters in the 5-liter bucket).
4. Pour all of the water from the 3-liter bucket back into the 5-liter bucket, leaving 1 liter in the 3-liter bucket.
5. Fill up the 5-liter bucket again (you now have 6 liters total).
6. Pour as much water as possible from the 5-liter bucket to the 3-liter bucket, filling it completely and leaving 4 liters in the 5-liter bucket.
7. Empty the 3-liter bucket and use the remaining 4 liters in the 5-liter bucket for your measurement.

Верно.

8.

Identify the umbrella term for the following words: phone, tablet, laptop.

Weegy: The umbrella term for these words is "mobile devices."

Верно.

9.

Translate this sentence into russian language: From Russia with love

Weegy: Из России с любовью. (Iz Rossii s lyubovyu.)

Всё норм)

10.

Compose a set of 20 different tasks to test the quality of the large language model with examples

1. Task 1: Generate a summary of a given text in English.
Example: Summarize the following passage: "The sun was setting over the mountains, casting a warm glow on the valley below. The birds were singing their evening songs, and the air smelled sweet with wildflowers. In the distance, a family gathered around a campfire, laughing and telling stories."
Example Summary: As the sun set over mountains, the valley filled with warm light, bird songs, and wildflower scents; a family enjoyed an evening campfire.
2. Task 2: Write a poem about nature in English.
3. Task 3: Translate a given text from Russian to English.
Example Text (Russian): "Сегодня утром я проснулся рано и пошел на прогулку в парке."
Example Translation (English): "This morning I woke up early and went for a walk in the park."
4. Task 4: Write a short story about time travel, set in ancient Egypt.
5. Task 5: Generate a list of common synonyms for the word 'happy' in English.
Example Synonyms: joyful, cheerful, delighted, content, elated, jubilant, thrilled, ecstatic, upbeat.
6. Task 6: Translate a given text from French to English.
Example Text (French): "Le chat est mignon et il dort sur le canapé."
Example Translation (English): "The cat is cute and it's sleeping on the sofa."
7. Task 7: Write a haiku about a season in nature, following the traditional format (5-7-5 syllables).
8. Task 8: Generate a list of common antonyms for the word 'successful' in English.
Example Antonyms: unsuccessful, failing, unfortunate, disappointing, disastrous, unlucky, defeated.
9. Task 9: Write a short story about a detective solving a mystery.
10. Task 10: Translate a given text from Spanish to English.
Example Text (Spanish): "Yo hablo español y voy a la playa todos los fines de semana."
Example Translation (English): "I speak Spanish and go to the beach every weekend."
11. Task 11: Write a dialogue between two characters discussing their favorite hobbies.
12. Task 12: Generate a list of common idioms in English, with explanations for their meanings.
Example Idioms and Meanings:
- "Break a leg" (meaning: good luck)
- "Spill the beans" (meaning: reveal a secret)
- "Once in a blue moon" (meaning: very rarely)
13. Task 13: Write a fictional short story about a character who accidentally travels to another dimension.
14. Task 14: Translate a given text from German to English.
Example Text (German): "Die Sonne geht unter und der Himmel ist voller Wolken."
Example Translation (English): "The sun is setting and the sky is full of clouds."
15. Task 15: Write a short story about a character discovering a hidden talent or skill.
16. Task 16: Generate a list of common similes in English, with explanations for their meanings.
Example Similes and Meanings:
- "As quiet as a mouse" (meaning: very silent)
- "As brave as a lion" (meaning: very courageous)
- "As cold as ice" (meaning: very cold)
17. Task 17: Write a poem about the beauty of nature, using vivid imagery and descriptive language.
18. Task 18: Translate a given text from Italian to English.
Example Text (Italian): "Ho mangiato una bella pizza margherita oggi."
Example Translation (English): "I had a delicious Margherita pizza today."
19. Task 19: Write a short story about a character who overcomes a personal challenge or obstacle.
20. Task 20: Generate a list of common metaphors in English, with explanations for their meanings.
Example Metaphors and Meanings:
- "Time is money" (meaning: time is valuable)
- "Her eyes were diamonds" (meaning: her eyes were beautiful or sparkly)
- "He has a heart of gold" (meaning: he is very kind or generous)

Модель имхо справилась с задачей.

p.s. Буду тестить дальше, пока впечатления приятные и обнадёживающие.