Edit model card

This repo provides the training checkpoint of LLaMA on the alpaca_data_gpt4 dataset via LoRA [MLP] on 4xA100(80G).

He et al. 2022 gave an insight that FFN can better utilize modification at larger capacities.

The codes is provided by tloen/alpaca-lora: Instruct-tune LLaMA on consumer hardware (github.com).

We modify the running scripts to

torchrun --nproc_per_node=4 finetune.py \
    --base_model '/cache1/chtan/large_models/llama-hf/llama-13b' \
    --data_path './alpaca_data_gpt4.json' \
    --output_dir './gpt4-alpaca-lora_mlp-13b' \
    --batch_size 128 \
    --micro_batch_size 32 \
    --num_epochs 10 \
    --learning_rate 1e-4 \
    --cutoff_len 512 \
    --val_set_size 2000 \
    --lora_r 16 \
    --lora_alpha 16 \
    --lora_dropout 0.05 \
    --lora_target_modules '[gate_proj,down_proj,up_proj]' \
    --train_on_inputs \
    --group_by_length

Examples

Instruction: Tell me about alpacas.

gpt4-alpaca-lora_mlp-13b: Alpacas are members of the camelid family, which also includes llamas, camels, and vicunas. They originated in the Andes Mountains of South America and were domesticated by the Incas for their soft, warm fleece. Alpacas are smaller than llamas, standing at an average height of 36 inches and weighing between 100 and 200 pounds. They have a distinctive appearance, with long, shaggy necks and ears, and a curved, black nose. Alpacas are social animals and live in herds, with a dominant male, or a stud, at the head. They are gentle and easy to care for, and are often kept as pets or for their fleece, which is used to make clothing, blankets, and other textiles. Alpacas are valued for their soft, lightweight fleece, which is warmer and more durable than wool. They are also known for their gentle nature and are often used as therapy animals.

Alpaca-LoRA: Alpacas are members of the camelid family and are native to the Andes Mountains of South America. They are known for their soft, luxurious fleece, which is used to make clothing, blankets, and other items. Alpacas are herbivores and graze on grasses and other plants. They are social animals and live in herds of up to 20 individuals.

Stanford Alpaca: Alpacas are small, fluffy animals related to camels and llamas. They are native to Peru and Bolivia, and were first domesticated around 5,000 years ago. They are kept mainly for their fine, soft fleece, which is used to make knitwear and other garments. Alpacas are herd animals and live in small family groups, led by an older male. They are highly social animals and can form strong bonds with their owners.

text-davinci-003: Alpacas are a domesticated species of South American camelid, similar to llamas. They are native to the Andes Mountains in South America and are kept as livestock for their soft, luxurious wool. Alpacas are social animals and live in herds of up to 20 individuals. They are typically kept in small herds of two to five animals, and are relatively easy to care for. Alpacas are herbivores and feed on grass, hay, and other vegetation. They are also known for their gentle and friendly nature, making them popular as pets.


Instruction: Write a Python program that prints the first 10 Fibonacci numbers.

gpt4-alpaca-lora_mlp-13b:

Here is a Python program that prints the first 10 Fibonacci numbers:

def fibonacci(n):
    a, b = 0, 1
    for i in range(n):
        print(a, end=' ')
        a, b = b, a + b
    print(a)

fibonacci(10)

This program defines a function called fibonacci that takes an integer n as an argument. Inside the function, we initialize two variables a and b with the values 0 and 1, respectively. Then, we use a for loop to iterate from 1 to n. For each iteration, we update the values of a and b using the Fibonacci sequence formula: a, b = b, a + b. After the loop is finished, we print the values of a and b using the print function. Finally, we call the fibonacci function with the value 10 as an argument, which will print the first 10 Fibonacci numbers.

Alpaca-LoRA:

def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n-1) + fibonacci(n-2)

print(fibonacci(10))

Stanford Alpaca:

numbers = [0, 1]

for i in range(2, 11):
    numbers.append(numbers[i-2] + numbers[i-1])

print(numbers)
# Output: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

text-davinci-003:

# Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones.

# Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...

# Program:

# Initialize the first two numbers of the Fibonacci sequence
a = 0
b = 1

# Print the first 10 numbers of the Fibonacci sequence
print(a)
print(b)

for i in range(2,10):
    c = a + b
    a = b
    b = c
    print(c)

[1] Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, Graham Neubig: Towards a Unified View of Parameter-Efficient Transfer Learning. ICLR 2022

Downloads last month
0
Inference Examples
Unable to determine this model's library. Check the docs .

Dataset used to train chtan/gpt4-alpaca-lora_mlp-13b