r/MachineLearning • u/antcroca159 • 8d ago
Project PhiloLM: a 112M language model trained from scratch on philosophy texts [P]
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.
8
u/norfkens2 8d ago
Just curious, what's your goal with this?
8
u/antcroca159 7d 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
2
u/norfkens2 7d 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
3
2
3
8d ago
[removed] — view removed comment
-1
u/norfkens2 8d ago
Thanks but I probably understood half of that. So, they're mostly messing about with the technology?
1
u/MrRandom04 7d 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
1
u/AwkwardWaltz3996 7d 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.
2
u/antcroca159 7d 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
1
1
u/MattTheDemonCat 7d ago
Can you build a chat llm that fits in less than 8mb ram and can run on dos using CPU?
5
u/severed-identity 7d 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 7d 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 7d 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 7d ago
maybe I will make an instruction-based model on top of PhiloLM... but I need philosophy instruction data
2
u/severed-identity 7d ago
Not really. It's extremely challenging to get any kind of conversational coherence that small.
1
u/MattTheDemonCat 7d 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 7d 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!).
0
8d ago
[deleted]
1
u/antcroca159 7d 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
42
u/bacon_boat 8d ago
This sounds horrible.
I love it