gpt-oss-20b-base

⚠️ WARNING: This model is not affiliated with or sanctioned in any way by OpenAI. Proceed with caution. ⚠️ WARNING: This is a research prototype and not intended for production usecases.

About

This model is an adapted version of the GPT-OSS 20B mixture-of-experts model, finetuned with a low-rank adapter to function as a base model.

Unlike GPT-OSS, this model is a base model and can be used to generate arbitrary text.

gpt-oss-20b-base is a LoRA finetune of the original GPT-OSS 20B model. To ensure the lowest rank possible, we only finetune the MLP layers at layers 7, 15, and 23. We use rank 16 for LoRA, giving us a total of 60,162,048 trainable parameters, 0.3% of the original model's 20,974,919,232 parameters. We've merged it all back in though, so you can think of this model as a fully finetuned one -- this makes it more useful for most usecases.

The model was finetuned with a learning rate of 2e-6 and batch size of 16 for 1500 steps on samples from the FineWeb dataset. Its maximum sequence length is 8192.

Usage


# Load model directly
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("jxm/gpt-oss-20b-base", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("jxm/gpt-oss-20b-base")

model.to("cuda")

sample_text = [
    "Hello, how are you?",
    "Why is the sky blue?",
    "Where in the world is Carmen Sandiego?",
    "Can you explain the theory of relativity?",
    "google.com/",
    "Twas brillig, and the slithy toves",
]

def generate(text: list[str], **kwargs) -> list[str]:
    text = [tokenizer.bos_token + t for t in text]
    tt = tokenizer(text, padding=True, padding_side="left", truncation=False, return_tensors="pt")
    tt = tt.to("cuda")
    outputs = model.generate(**tt, **kwargs)
    return tokenizer.batch_decode(outputs)

outputs = generate(sample_text, max_new_tokens=100)

print('\n\n'.join(outputs))

Chat template

This model was trained without a chat template. It will not function as a base model if you use the chat template! To generate text, simple prepend the text with tokenizer.bos_token ('<|startoftext|>') and tokenize without a template.

(Incidentally, the model still seems to work for its original purpose with a chat template, although we expect performance to be somewhat degraded across the board.)

Examples

Here are some examples I generated from some random prompts.

Prompt Output
Hello! How are you doing? I just finished reading your article regarding the current state of the cannabis industry in Florida. I really enjoyed it and I appreciate your efforts to educate. Please add me as a friend on Facebook so that I can continue reading your future articles, which I am sure you will write to cover more such important issues relating to all the
Hi! what's your name? I'm Tiffani, but you can call me Tiff. I'm 19 years old and I love to sing! Do you want to sing together? Hey Tiff, what's your favorite song? I'm curious. (Tiffani :3) my favorite is "Don't Call Me" by Demi Lovato.
What is the capital of France? Who is the president of Peru? How many ounces are in a pound? What is the largest country in Africa? Who wrote Harry Potter? When does the Winter Olympics start in 2022? What is the largest desert in the world? Which is the oldest country in the world? What is the capital of Canada?
What is your favorite coding language? Let me know in the comments. What do you need help "with online? Lets work "on it together! Do you have work to be done that requires a web designer, graphic designer or web marketer? I can help you out. If you have any questions, feel free to reach out in the comments or via private message
Where in the world is Carmen Sandiego? This game is really simple. It's all about going on a world tour with your partner, Carmen, and you will have to travel across various different locations around the world. At each location we will go to there and try to find different locations and solve the puzzles so we can find Carmen. We are going around the world searching for her. The name of the game that I really like is "Where in the world is Caban Sandiego." The game is very fun to play and we can use
Why is the sky blue? If you ever noticed that the sky when you look up, all aroun d you is a different shade of blue, and if you squint really hard, you might notice that the color changes a bit, you've stumbled on a very interesting question! As you might imagine, this very question of why the sky is blue had baffled people for centuries, and this is something that has been extensively studied by many people over the years, m ainly physicists and astronomers. When a physicist from Sweden named Anders
Can you explain the theory of relativity? The question here is: what does gravity look like in an accelerating car? That's a good question. Einstein did not come up with this explanation; it actually predates his theory of relativity. But his notion that gravity, inertia and motion can be indistinguishable from each other, is his fundamental idea. A few words: gravitation in a car? You may think how heavy you feel is gravity. And maybe in a car you'd have to brake or jump, you'd feel gravity change? No
google.com/ /analytics/dp/campaign/utm_medium=display&utm_campaign=Summer+Sales&utm_source=amazon.com&utm_user_id=%5Blender_userid%5D&utm_content=Banner5facebook.compinterest.com
Twas brillig, and the slithy toves; Did gyre and gimble in the wabe; All mimsy were the borogoves, And the mome raths outgimbling. In the haethy, a white bope Creeping across the clove...
Downloads last month
-
Safetensors
Model size
20.9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for jxm/gpt-oss-20b-base

Base model

openai/gpt-oss-20b
Finetuned
(125)
this model
Quantizations
3 models

Dataset used to train jxm/gpt-oss-20b-base