←
Mohammad Kaif | FullStack Developer | GEN AI168 posts
Mohammad Kaif | FullStack Developer | GEN AI avatar

Mohammad Kaif | FullStack Developer | GEN AI

@dev_kaif_

CSE ( AIML ) -Mumbai University Linkedin : linkedin.com/in/mohammadkaif… GitHub: github.com/Dev-kaif

◷ Joined June 2019▧ 74 Photos and videos
Akshay 🚀 avatar
⟳ Mohammad Kaif | FullStack Developer | GEN AI retweeted
Akshay 🚀@akshay_pachaar·Nov 6

As an AI engineer, please learn: - Learn the roofline model and why decode is memory-bound - Deploy vLLM and SGLang, then read their schedulers - Understand paged attention from the code, not the blog post - Build observability before you optimize anything - Track TTFT, inter-token latency, throughput, queue depth - Use Grafana + Prometheus for inference dashboards - Turn on prefix caching and find which workloads it helps - Learn continuous batching and chunked prefill - Run load tests with 1000+ concurrent requests - Report p50, p95, p99, never just the mean - Master quantization tradeoffs (FP8, INT4, AWQ, GPTQ) - Learn speculative decoding and where it stops helping - Set up KV cache eviction for long contexts - Try disaggregated prefill and decode serving - Learn Kubernetes for AI workloads and autoscale on queue depth - Learn how inference costs break unit economics - Build your own model router by cost, latency, quality - Create a token budgeting system per request - Build one inference service and benchmark it publicly - Read inference research instead of model release news - Start sharing your optimization benchmarks I put together a 10-week plan that covers every one of these at 30 minutes a day. It is 50 sessions, split between reading the theory and building on your own service, and all of them feed one artifact: an inference service you deploy, instrument, load test past 1000 concurrent requests, tune, and publish as a reproducible benchmark. It is open on GitHub and contributions are welcome, especially newer sources worth adding. I am working through it myself and will share more content on this going forward, so stay tuned. GitHub repo: github.com/patchy631/time-to… (don't forget to star 🌟)

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 30

12 days into grinding Neetcode 150, and I’ve finally crossed the halfway mark. Started it to revise DSA, but ended up learning a lot of new stuff. Great sheet ngl. How relevant is Neetcode 150 for tech interviews in India tech interview setup?

Post attachmentPost attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 29

"The dog chased the cat" and "The cat chased the dog" contain the same tokens, but mean different things. The order changes the meaning. That's why positional information is important: the model needs to know not only which tokens exist, but where they appear.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 29

When generating sinusoidal positional encodings, we use different sine and cosine frequencies across the embedding dimensions. Some dimensions change quickly, while others change slowly. Together, these patterns give each position a unique representation of its position.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 29

During positional encoding, we can use sinusoidal functions to represent each position. Sine and cosine generate different patterns across the embedding dimensions. Each position gets a distinctive pattern, giving the transformer information about where each token appears.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 29

Positional encoding gives each token information about its position in the sequence. So the transformer receives both: what the token is + where it appears This helps it understand the order and relationships between tokens.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 29

Moving from token embeddings to positional information. A token embedding tells the model what a token represents, but not where it appears. Since transformers process tokens in parallel rather than sequentially, the model needs positional information to understand their order.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 18

Moving from tokenization to embedding was interesting. A token ID points to a row in the embedding matrix, and that row becomes the vector representation of the token. So instead of working with cat = 42, the model works with a high-dimensional vector associated with that token

Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 18

The embedding dimension is the number of values used to represent each token. 50,000 tokens × 768 dimensions gives a 50,000 × 768 embedding matrix with 38,400,000 parameters. Each row has 768 values representing the token at that token ID. The ID simply points to that row.

Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 18

The embedding matrix it's basically: -> vocab size × embedding dimension Vocab size = the number of tokens in the tokenizer's vocabulary. Each row corresponds to one token, and the row contains the vector representation for that token.

Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 17

Learned about token IDs and what happens after tokenization. flow : text → tokens → token IDs A token ID isn't the meaning or representation of the token. It's basically an index that tells the model which token it is and which row to look up in the embedding matrix.

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 17

Learning about tokenization helped me understand the "strawberry" problem. An LLM can struggle to count the "r"s because the word may be split into multiple tokens. The model doesn't see the original word as one unit. More of a architectural issue than the LLM being "stupid."

Post attachment
Mohammad Kaif | FullStack Developer | GEN AI avatar
Mohammad Kaif | FullStack Developer | GEN AI@dev_kaif_·Sep 17

Spent some time learning about BPE and how tokenizers build their vocabulary by merging frequently occurring pairs. Also played around with tokenizers to see how normal sentences, spaces, contractions, and weird strings actually get split.

Post attachment