How Fine-Tuning Warps the Hidden Geometry of Transformers

A transformer is trained to predict tokens, but in the process it learns something richer than a next-token probability distribution. It learns a geometry over tokens and contexts. Hidden states become points in a high-dimensional space, encoding semantic, syntactic, and task-specific information...
Continue reading →

Fast Exponentiation and Modular Exponentiation

I give an exposition of both the fast exponentiation and modular exponentiation algorithms, then we apply the latter to the LeetCode problem 2438. Range Product Queries of Powers. The solution to this problem presented here differs substantially from the solution provided in the LeetCode editoria...
Continue reading →