Dev Patel (@devpatelio) header
Dev Patel (@devpatelio) profile picture
SF, CA
Joined June 2022
Our work at @novaskyai with @afterquery on integrating SDPO into visual code generation is out! We explored how targeted feedback, teacher selection, and KL approximations affect sdpo training, with cool findings on stability and efficiency.
We added support for SDPO in SkyRL alongside UC Berkeley SkyLab researchers. Our new blog explores self-distillation across math, document, and chart-to-code tasks. On MATH-500, Qwen3-8B improved from 85.6% to 91.2% (+5.6 points), while using 8× fewer rollouts than GRPO. afterquery.com/blog/on-polic…
3
6
66
3,872
Basic matmul optimization: These really small models were performing pretty slow, so I ended up using xsimd for hardware-agnostic vectorized matrix multiplication that gave me an 8.6x speedup across all training scenarios. The inner loop uses SIMD batches to process multiple elements simultaneously, which dropped total training time from 4.7 minutes to 32 seconds.
2
1
10
964
Testing the framework: To see if our code was actually suitable for learning and there weren’t any weird quirks in the math, I tested the framework on the XOR gate problem (non-linearly separable) and 4-feature binary classification tasks, comparing cross-entropy versus MSE loss performance. Both approaches achieved 98-100% accuracy on test data (depending on the seed). I’m also really proud of using GraphViz to view the generated computation graphs that characterize the complete gradient flow.
1
1
9
835
Going from scalars to tensors: To move from scalars to tensors, I had to implement an N-dimensional tensor class with shape and strides, matrix multiplication with proper gradient computation, NumPy-style broadcasting for element-wise operations, and gradient shape fitting for backpropagation. These operations require shape compatibility checking, dimension expansion, and proper gradient accumulation. However, backpropagation was surprisingly simple to modify thanks to linearity!
1
2
10
913
Building the backward pass: This code automatically builds the graph and then computes gradients for all the nodes. Implementing the reverse-mode autodiff required three steps: > topologically sorting the computation graph (which was easy to do with our node design) > walking backwards through nodes by calculating the gradients of the previous nodes > letting each node compute its local gradient while we accumulate them with the prior gradients (simple chain rule).
2
1
9
1,013
Effective system design: The first challenge was building computational graph nodes that could track their own gradients. Each Value object holds the data (scalars initially, tensors later), a gradient accumulator, an operation tag like "add" or "relu", and parent pointers for backpropagation. Operations automatically build the graph as you compute by tracking their inputs. Then, I got to work building out a fairly basic BCE and MSE loss function that worked well with scalars along with AdamW and ReLU activations.
1
2
10
1,180
Before I start my internship @AMD AI next week, I spent some time on a project that I've been wanting to do for a while. I built a neural network framework from scratch in C++ to understand the fundamentals of automatic differentiation and computational graphs.
13
10
5
166
18,209
Jeez ConnexSci shout on @HackTheNorth. Go apply for 2024! hackthenorth.com/
2
199
Just learned about this @Meta… I don’t know what to think. variety.com/vip/celebrity-ju…
200