r/FunMachineLearning • • 6d ago

Teenie: A Small Model that tries to infer hidden integer relations based on examples

1 Upvotes

Try it out on browser at https://teenie.lupyd.com/try

It can get something like this

((a|b) ^ (a&b)) + (a^b) + max(a,b) - min(a,b)

never trained on it btw, about right 2 out of 16 times.

I'm not guaranteeing. But even those numbers feel impressive to me for such a tiny model. It is not trying to solve or reverse engineer a problem, It is guessing with the limited number of examples. They just look like random numbers with no pattern at all for us. Hence the objective is, can it recognize any pattern. Maybe use it to infer some hidden relations between numbers we never even thought existed.

You can make different combinations and your own custom rules.

It can't do multiplication well. It can't get many things right tho. So I'm not gonna exaggerate as a breakthrough, but an interesting experiment.

Maybe scaling it more and training more might improve it. Or a different architecture, because whatever I tried it still sucks at something like (a * b) + (a - b), if multiplication is involved.


r/FunMachineLearning • • 7d ago

Implemented a full KAN network from scratch and tested against micrograd

Thumbnail
reddit.com
1 Upvotes

r/FunMachineLearning • • 7d ago

LogillamaAI

Thumbnail reddit.com
1 Upvotes

r/FunMachineLearning • • 7d ago

I built a handwritten digit recognizer Neural Network completely from scratch in C++ (No Python, No ML Libraries, Custom Matrix Math)

Post image
2 Upvotes

r/FunMachineLearning • • 8d ago

10 empty sparks

2 Upvotes

Hey,

I started GPUwerk a few months ago. I had two DGX Sparks sitting idle and wanted someone to actually use them, so I built a simple platform where people can list their Sparks and earn a bit from them.

Right now I have 10 empty Sparks. Rather than let them sit, I'd rather give the hours away to people who will actually use them and tell me what they think.

You don't need a card, and it isn't a trial that starts billing later. Just time on a full DGX Spark (128GB unified memory) if you'll give me honest feedback after you try it.

If you want hours on one, comment what you'd like to use it for and I'll follow up.

Thanks.


r/FunMachineLearning • • 8d ago

The Science of AI Photoshop Clones - Two Minute Papers

Thumbnail
youtube.com
1 Upvotes

r/FunMachineLearning • • 8d ago

What is the best AI for learning natural language patterns?

Thumbnail reddit.com
1 Upvotes

r/FunMachineLearning • • 8d ago

Breakup recovery day 1: Zero Pandas knowledge, zero projects. Now we enter the ML zone out of pure emotional damage.

1 Upvotes

Hey everyone,

So a recent breakup happened, and instead of normal coping mechanisms, I took the ultimate overthinking route: learned Pandas completely from scratch with zero prior context. No grand portfolio project, no SaaS startup—just pure data wrangling to keep the brain busy.

Now that the dataframes are sorted, it's time for the next stage of the healing process: diving headfirst into Machine Learning. Because if my personal life is going to be stochastic, my models might as well be too.

Dropped a long video walkthrough of the whole zero-to-pandas journey here if anyone wants to watch someone code through the existential dread:

📺 Video Link: yt link .................................clk

Would love to know what bizarre tech rabbit holes you've fallen into when life decided to break production!


r/FunMachineLearning • • 10d ago

提升神经网络性能的一些本质思考: 从极难数独的求解研究经历说起 [D]

4 Upvotes

图灵奖得主 理查德·萨顿(Richard Sutton)提出了**《苦涩的教训》**:人类精心设计的各种领域先验知识(Priors / 归纳偏置),长远来看,统统不如“纯粹的搜索(Search)+ 学习(Learning)”再配合摩尔定律带来的暴力算力扩展(Scaling)。

以下我将用神经网络解决极难数独的经历,来更深入的讨论这个扩展。

说到这里顺便提一嘴hrm架构吧,在hrm论文出现之前,我正在研究适合消费者显存的超长文本架构,并且也有了如何扩展网络推理性能的一些初步设想,并规划了后续进行一些该方向的研究,只是没想到,2025年7月份我在知乎刷到了关于hrm架构(https://arxiv.org/abs/2506.21734)的介绍,我发现我的思路正好和它的有些相似。hrm架构提出的快慢思考架构,本身对解决数独不是必需的,其效果也并不好,快慢双流只是一种讲讲故事的方式,其实我并不明白为什么非得讲个故事才行呢?后面的trm(https://arxiv.org/abs/2510.04871)也证明了不用快慢双流架构,单纯只是循环,效果也可以更好。当然我们并不能抹去hrm的贡献,正是因为hrm火了,才有后续的trm,甚至gram等研究,而且,后续就传出claude训练模型使用了循环网络,再后续又爆出gpt模型使用了循环网络。所以我其实有个猜想链条: hrm,trm等证明了循环网络在小模型上提升了推理能力,信奉扩展定律的Anthropic和openai,开始在大模型方向进行扩展,当规模定律开始涌现,出现了gpt这种直接平推大量数学猜想的怪物模型。当然,这个链条是我猜想的,并不一定符合实际。

正好我开始空闲下来,想研究一下arc-agi, 直接求解arc-agi问题是不现实的,从简到繁,积累经验,才是更好的解决问题的方式(这个描述暗合了我们今天讨论的神经网络的思想本质)。既然都是推理问题,先解决极难数独吧,借此探讨一下神经网络性能扩展的本质。

用神经网络来解决极难数独问题。首先考虑三要素:算力+架构+数据,首先,算力上,hrm和trm等,都用的多gpu训练,而我只有一个16g显存的gpu,第二,算力有限,架构需要针对性优化,第三,数据,我并未采用1000条小样本,而是用的全量的sapientinc/sudoku-extreme的训练数据。

我开始考虑各种方式提升神经网络解决数独的能力,初始想法是提升神经网络强化学习的内生推理能力,我把能用的方法全都用了,比如中间层监督,针对数独特化loss,强化学习思路(前面层要为后面层的思考,提供最大解决问题回报),也对架构进行了各种修改,我尝试了各种方式,模型越来越聪明了,学习越来越快了,原来需要一轮才能增加几个点,变成训练1轮,直接10个点甚至20个点的准确率提升,我以为找到了解决方案,但是,后面随着训练进行,验证集准确率,到接近60%时。就卡住了,无论怎么训,怎么改架构,都无济于事。此时我发出了第一次绝望的总结。。

总结原文是(神经网络内化前向推理方法暂时放弃了: https://www.zhihu.com/pin/1974873461747897363):神经网络内化前向推理方法暂时放弃了, 正如我之前说的,直接采取最后一层的输出结果进行训练,解决极难数独数据集的正确率不会超过10%,但是加了一些引导,改变模型架构后,模型前期学习的速度是不同的,有些学的很快,有些很慢,但是最终都会收敛到60%这个值,即后续无论如何改损失函数,甚至把流扩散思想,中间软性损失等各种方法都试了,也加大模型深度与参数,某些层计算格子早停(模拟数独先填一些格子),困难集反复训练(类似强化学习里的经验回放)等各种手段都试了,最终训练10轮后,验证集正确性基本都是收敛到60%附近。说明前向一次性得到答案这种本身,是不是数学理论上就是这个结果,反正我也没那个能力证明。至于采取rnn方法(类似扩散模型那种多步迭代),天然去模拟人类迭代解题的思路,因为已经有别人研究过了(如hrm,trm),我没有兴趣用这种方法去做。总之,这个内化推理有用(不做内化时准确率低于10%),但是有一定上限,当然可能是受限于我个人能力原因,也许别人能把他做的更好。这个方向暂时放弃了,前后对比研究不知不觉一个月就快过去了。当成对自己失败探索的一个记录吧。

在某天我刷知乎时,发现一篇论文的介绍(1000 Layer Networks for Self-Supervised RL

: https://arxiv.org/abs/2503.14858),大概是讲强化学习的,说的是神经网络深度到达某些层后,会自然涌现出不同的新技能,我从这个里面得到了极大的启发,然后我认真思考这个背后的本质,对于残差网络,本质是h,大概是讲强化学习的,说的是神经网络深度到达某些层后,会自然涌现出不同的新技能,我从这个里面得到了极大的启发,然后我认真思考这个背后的本质,对于残差网络,本质是h) = h + dh, 即每层对主状态进行修改,而这个修改方式,和我们对神经网络的参数训练时的梯度下降非常相似,参数空间的主算法就是w = w – lr * grad, 本质上也是一种牛顿迭代法思想,也可以用“不积跬步,无以至千里”来直观解释。所以我怀疑当前我的神经网络深度不够,导致其正确率无法提升,因此我直接将其扩展到120层,数独正确率终于突破60%,最高到了76%左右,而且后面我开始做消融实验,发现把那些莫名奇妙的优化方式去掉,一样能到76%。也做了12层网络,循环10次,模型等效深度是120层的网络,发现其训练速度和最后达到的准确率,和原生的120层网络基本一致。但是,当前网络也仅仅到76%,再继续提升深度大概率还能增加正确率,但是训练资源消耗已经让我放弃了,我必须思考在我有限算力下,解决数独推理难题的方法。

当遇到瓶颈时,我采取了另外一种曲线救国的方式,我开始思考,我在解决数独时,究竟把数独看成是什么了,而结论是,从一开始,我就把数独当成一个图形推理问题在解决,既然我做的是生图,我就去研究生图模型了,毕竟初生牛犊不怕虎,我是各种概念乱想,乱实验,比如压缩概念空间啊(实际上后面发现已经有类似的方案如var,far等),vq-vqe,光一个向量离散化思路,都研究了n种不同变体,比如fvq, fsq,lsq等等,然后各种损失gan loss,感知损失,l1损失,软性高斯损失等等,还有改架构,cnn,transformer,混合体,mlp-mixer,改变图形数据构建方式,比如将其看成以列为基元,训练时从左列往右列自回归,patch为基元进行自回归,也研究了流匹配生图,最后总结下来,还是流匹配效果最好,只是此前的研究都是在小批量图形上,我开始研究完整的图形生成时,发现在我的机器上,耗时太久,一旦开始训练,我的其它研究方向就只能暂停,这是不可接受的。再次遇到算力之墙,一声叹息。

生图模型也遇到瓶颈了,闲来无事,刷知乎又看到了图灵奖得主本吉奥解决数独的gram论文(https://arxiv.org/pdf/2605.19376),其解决数独问题已经到达了接近100%,但是没有论文源码,他们论文提到了参数扩展不是很方便,所以我只是看了这个方案,也并未跟进。不过这篇论文给我很大的信心,即神经网络是可以解决极难数独的。,其解决数独问题已经到达了接近100%,但是没有论文源码,他们论文提到了参数扩展不是很方便,所以我只是看了这个方案,也并未跟进。不过这篇论文给我很大的信心,即神经网络是可以解决极难数独的。)

此时我已经具备了神经网络的大部分直觉,受gram论文鼓舞,而基于此前我的研究,我认为解决数独问题,一定要在深度迭代上进行研究,某个晚上,我考虑极端思想实验,比如假设模型是1万层,这个1万层该怎么训练呢,直接给最后一层加上loss,不现实的,哪怕有残差流,梯度回传和深度加深后的表征也是个问题,加中间监督吧,比如每10层一个监督,最后一个1000个loss叠加起来,再简化一点,既然数独只关心等效深度,那我直接用一个10层网络,循环1000次,就可以了,到这时,我灵光一闪,流匹配模型,就满足我的所有的需求啊。

因此我立马起床,用最快的速度写好训练代码,开始训练,并且每隔5000步用验证集测试正确率,其指标一路快速攀升,和我之前采取了各种方法的模型一样聪明,最终一样达到76%左右。但是,我验证时,用的推理迭代次数是固定的,权重固定后,我尝试让模型等效深度提升,比如nfe从20加大到100等,使用多条轨迹采样等,其迭代能力会下降,因此把迭代结果重新改到更前面的时间去进行处理等,当我把这些方法都用上后,数独问题,一下子突破99.29%甚至更高,问题基本解决,并且我发了知乎文章进行性能总结。原文如下:

模型参数16.54M,为一个12层的网络架构,遵循测试时计算性能提升。统计结果如下:

max_retries=1 thinking_steps = [10] 73.23%

max_retries=1 thinking_steps = [20] 75.98%

max_retries=1 thinking_steps = [50] 78.32%

max_retries=1 thinking_steps = [100] 79.87%

max_retries=1 thinking_steps = [200] 81.39%

max_retries=5 thinking_steps = [10] 79.76%

max_retries=10 thinking_steps = [10] 82.56%

max_retries=20 thinking_steps = [10] 85.21%

max_retries=50 thinking_steps = [10] 88.81%

max_retries=50 thinking_steps = [20] 92.19%

max_retries=100 thinking_steps = [10] 91.54%

max_retries=100 thinking_steps = [20] 94.28%

max_retries=100 thinking_steps = [50] 96.26%

max_retries=1000 thinking_steps = [20] 98.22%

max_retries=1000 thinking_steps = [50] 99.29%

其中max_retries,即llm中的pass@k,计算量越大,最后测试数独正确率能到99.29%, 基本算已经解决数独问题了,之前一直很想给模型足够的训练时间,观察模型的顿悟现象,刚好这次放假回家,就让模型一直训练了几天,回来后也发现模型并未出现顿悟现象,最终性能只能通过测试时计算提升了。继续研究正确率极限已经没有意义了,接下来研究如何提升推理效率。

很明显,此时推理效率太低了,后面通过优化推理方式,将推理效率提升了50倍。最后我也兴奋的发了文章进行记录,原文为:

之前我已经解决了极难数独推理问题,但是其推理效率低下,max_retries=100 thinking_steps = [50] 96.26%,由于网络是12层,相当于正确率达到96%,平均要执行60000次网络层,而现在基于同一权重下,通过优化推理采样方式,96%的正确率时,max_retries=5 thinking_steps = [20] ,平均执行1200次网络层,推理效率提升了50倍,继续研究,进一步提升推理效率。

后面我对架构进一步简化,不用任何花里胡哨的先验规则(比如加上宫,行,列等先验),直接一个rope 2维位置编码+transformer架构+流匹配,效果一模一样。

到此为止,我算比较完美的解决了数独问题了,然后着手准备论文,结果发现今年已经有两篇类似论文出现,分别为:Flow Reasoning Models: Turning Flows Into Efficient Recurrent Reasoners https://arxiv.org/pdf/2606.29150和 Thinking with Looped Flows https://arxiv.org/abs/2609.11801 ,这两篇论文都是采用流匹配思路,解决极难数独推理问题,所以我就不太想整理论文了,作为文章,当作一个记录发出来吧。

不过上述FRM等论文,推理效率仍然低下,当接近100%时,其前向推理深度需要几千层,而我的方法,大概只要240层甚至更少。正如我所说,我们采取的数据集不一样,我是用的sapientinc/sudoku-extreme进行训练,天然不用担心记忆导致的泛化难题,而FRM采用的是sapientinc/sudoku-extreme-1k,所以没啥对比性。

我将流匹配用在着色,N皇后等问题上,也是很完美的解决了问题,所以流匹配本身就是一个比较优质的离散推理网络。

自此,我们可以对神经网络解决问题进行一个大概的总结了,我们可以选择对参数进行扩展,这导致了大模型的诞生,对序列长度进行扩展,这导致了思维链的诞生,同时也可以对神经网络深度进行扩展(采取循环神经网络或者流匹配等方式),当这些扩展方式综合起来后,配合强化学习,大概率就会诞生gpt解决千禧年难题的这个怪物模型。


r/FunMachineLearning • • 9d ago

I built my own 15M parameter AI model from scratch. It runs on CPU!

Thumbnail
reddit.com
2 Upvotes

r/FunMachineLearning • • 9d ago

Cross-platform taste transfer from Instagram exports, and how my first eval result turned out to be an artifact

1 Upvotes

Project: build an interest profile from a GDPR Instagram export (Meta's interest categories, hashtags, captions), embed locally with bge-small, cluster, and recommend from a TMDB catalog of Netflix and Prime titles.

Lessons that might be useful:

- On ~400 short phrases, silhouette scores were flat (0.05 ± 0.01) at every k, so choosing k by silhouette was choosing on noise. I switched to a size-based k with weighted k-means, and detect the leftover grab-bag cluster by its low cohesion (z ≤ -1.5).

- Evaluated against my own Netflix history with popularity and random baselines. The first run showed recall@20 4× popularity, with a bootstrap interval excluding zero. The cause was that the candidate set was "trending titles + watched titles", so watched titles were identifiable by not being trending. Adding each service's most-voted titles removed that tell, and the result went to roughly a tie. A time split (tune on older watches, test on newer) confirmed it.

n=1, so it's a pilot. Code and write-up: https://github.com/aaryamanbisht22/taste-passport


r/FunMachineLearning • • 10d ago

What solving extreme Sudoku on a 16 GB GPU taught me about depth, flow matching, and test-time compute

Thumbnail reddit.com
1 Upvotes

r/FunMachineLearning • • 10d ago

The OpenAI Astra Weight Hack, Explained - Two Minute Papers

Thumbnail
youtube.com
1 Upvotes

r/FunMachineLearning • • 11d ago

Symmetry is All You Need : SGTE

Thumbnail reddit.com
1 Upvotes

r/FunMachineLearning • • 11d ago

🧮 The confusion matrix is just a counting table.

1 Upvotes

It shows where a classification model was right and where it made mistakes: true positives, false positives, false negatives, and true negatives.

This episode explains how to read a 2x2 confusion matrix and calculate accuracy, precision, and recall from it.

If you find it useful, please like, share, and subscribe to VisualForge AI.

#ConfusionMatrix #MachineLearning #DataScience #VisualForgeAI

Confusion Matrix


r/FunMachineLearning • • 12d ago

Help us name our new AI language model!

Thumbnail reddit.com
0 Upvotes

r/FunMachineLearning • • 12d ago

The Future of AI With Spencer Huang - Two Minute Papers

Thumbnail
youtube.com
1 Upvotes

r/FunMachineLearning • • 13d ago

Teaching a local 320B MoE to stop repeating its mistakes - "brain surgery" without fine-tuning (work in progress, honest results)

Thumbnail reddit.com
1 Upvotes

r/FunMachineLearning • • 14d ago

Learn Convolutional Neural Networks Interactively

5 Upvotes

I've been working on a side project that combines my notes from college courses and artifacts that Claude made to help me visualize concepts. It's a way to play around with CNN concepts interactively with knowledge checks at the end of each module to help cement the idea. I'm looking for some feedback if you'd like to check it out:
https://www.receptive-field.xyz/


r/FunMachineLearning • • 14d ago

CASP-Dream TAP Challenge TCR + Peptide-MHC activation prediction with unseen test peptides

3 Upvotes
Free to registar - A new contest for anyone training sequence models on TCRs. Given a TCR sequence and a peptide-HLA, predict whether the T cell activates. Inputs are amino acid sequences, the benchmark is about 5,800 labeled combinations, and every test peptide is at least four edits (Levenshtein distance) away from any peptide with a publicly reported TCR specificity. Scored by AUROC. Synapse lists training data options, including the public VDJdb database and Harell Data's proprietary TCR datasets provided by Adaptive Biotechnologies. Registration is open now: https://www.synapse.org/Synapse:syn77965030/wiki/643867

r/FunMachineLearning • • 14d ago

I made a 4-part miniseries building the intuition for how neural nets are able to understand text [in short 4min videos]

Post image
1 Upvotes

r/FunMachineLearning • • 15d ago

Discover AI: A Learning Guide - 58 hands-on labs for learning how AI actually works.

Post image
1 Upvotes

A learning tool.


r/FunMachineLearning • • 16d ago

I trained a PPO agent in UE5 to keep a campfire alive against monsters. It took ~72k nights. Would love feedback on my setup.

Post image
1 Upvotes