r/MachineLearning • • 3d ago

Project PhiloLM: a 112M language model trained from scratch on philosophy texts [P]

Post image

I trained PhiloLM, a 112M-parameter language model from scratch using only openly available philosophy texts.

The training corpus, PhiloText, contains 0.5B tokens from philosophy encyclopedias (SEP, IEP), public-domain books, reviews, textbooks, and educational resources.

The model was trained on 1.5B tokens in 15 hours on a single Intel Arc A770 (16 GB). The architecture uses grouped-query attention, sliding-window attention, bigram embeddings, and the Muon optimizer.

Model and technical details: https://huggingface.co/gustavecortal/PhiloLM

The training dataset and interactive demo are also publicly available. Happy to discuss the architecture, training setup, or results.

95 Upvotes

31 comments sorted by

36

u/bacon_boat 3d ago

This sounds horrible. 

I love it

8

u/norfkens2 3d ago

Just curious, what's your goal with this?

5

u/antcroca159 2d ago

Observe what kind of behaviours you can have with training only on philosophy, the model has to learn everything (including English grammar) from scratch

1

u/norfkens2 2d ago

Interesting, thank you.

I listened to the current episode of the "Corner piece" podcast today. They were discussing with experts what romance actually is. I asked PhiloLM and it provided some very similar answers.

1

u/antcroca159 2d ago

yay thank you :)

1

u/cocacokareddit 2d ago

create Vision instead of Ultron

0

u/AwkwardWaltz3996 2d ago

To make the first LLM that will skirt around your question forever

3

u/[deleted] 3d ago

[removed] — view removed comment

-1

u/norfkens2 3d ago

Thanks but I probably understood half of that. So, they're mostly messing about with the technology?

1

u/MrRandom04 3d ago

They wanted to see if this dataset could be used for training a tiny model well. We experiment with different model architectures. In general, we want to try to train them quickly and cheaply to see if our ideas work or not. TinyStories is a common dataset used for it. This is potentially a more interesting one than TinyStories, which many find a bit boring.

1

u/norfkens2 2d ago

Thank you. That's a very helpful explanation.

1

u/AwkwardWaltz3996 2d ago

How are Intel Arc gpus for training and general development? I've wanted one for a while but feared it would suck due to Cuda stuff. You're the first person I've seen use one for machine learning.

1

u/antcroca159 2d ago

Intel Arc GPUs are now very good for training and inference. You can also use Claude to optimize kernels for Intel GPUs. Honestly, I do not feel like it is a limitation anymore to use Intel cards

1

u/arcandor 2d ago

Awesome work!

1

u/antcroca159 2d ago

thank you :)

1

u/vale_valerio 3d ago

Can you make the modifications to run the model in Ollama please? LoL

1

u/antcroca159 2d ago

I will do it!

3

u/McSendo 3d ago

Thanks. Looking forward to reproducing it soon and apply it to another similar domain.

1

u/MattTheDemonCat 2d ago

Can you build a chat llm that fits in less than 8mb ram and can run on dos using CPU?

4

u/severed-identity 2d ago

There's this https://kyle.fi/askjoyce/ - model is 4.5 mb, trained on Finnegan's Wake, and talks like it's blackout drunk.

—Trent to a light, a laid in the nabit of the whoo-who-who-who-at-uc-whatchwalkaft. Be our deedstake. Look at the buttle of I Why? And dry like the prime still in the world? Ever comes out of a hill of a hind make shim. Brinabride, my cold marthyrs! The four courts and with the trigmen gyre and rights and all the morning. And as your own weaker to where she’ll be squirtscreened thereon other’s thankskissing. The childher especially of the silence bares. One still same dreamber trees, the bloomers blague, reconciled

1

u/MattTheDemonCat 2d ago

I have used an llm on the 486 before. But it was trained on tiny stories. I am looking for one you can chat with. Reply and response ya know?

Does that one have that?

3

u/arcandor 2d ago

Smol LM has variants that are pretty low param count like this, and they can chat. I think they were trained on a good amount more text than most other small model projects you see.

2

u/antcroca159 2d ago

maybe I will make an instruction-based model on top of PhiloLM... but I need philosophy instruction data

2

u/severed-identity 2d ago

Not really. It's extremely challenging to get any kind of conversational coherence that small.

1

u/MattTheDemonCat 2d ago

I have been trying to get chatgpt to make me something to do that, or at least give me the files to automate training the model and then giving me the executable files to go with it.

But I don't pay for any subscriptions! Lol

I imagine it'll eventually be possible that it is figured it out. More and more complex models have been able to run on weeker and weeker hardware.

More complex but also not in some ways. I suppose more optimized is appropriate.

I mean, it makes relatively coherent strings of text like a story with tiny stories at about 1.something tokens per second (so pretty much real time, hardly a wait for the next, I guess on average 1 second per word). I was thinking if I can either get a quantized and just barely big enough chat trained model for basic back and forth conversation, it could fit and run usably. Or I was thinking if I could either take the existing text gen llm type model and apply it to a different system that has it respond using the text gen model. Or altogether if I could get a model that wasn't an LLM but rather on the level of what cleverbot did where it essentially had a huge library of responses to a bunch of varingly specific phrases + taking in the user response as a guide on how to respond in the future.

With gen AI I thought it would be easier for the last one, but chatgpt wasn't able to get me very far.

Right now I am dedicating my limited Claude time to getting a 3D horror game developed for this low power hardware, but when I am satisfied with that I might revisit this idea using claude.

2

u/arcandor 2d ago

You might be better served without true generative and pre bake the options (using generative you could potentially have tons, but good luck play testing!).

1

u/sasizza 3d ago

A magic ebook

0

u/[deleted] 3d ago

[deleted] — view deleted comment

1

u/antcroca159 3d ago

You can read more info on the dataset on https://huggingface.co/datasets/gustavecortal/PhiloText

Data is dedup and filtered, 0.5B unique tokens, 1.5B tokens during the training so several passes on the same data, last training steps are on a high-quality subset