Hello! I am a PhD student in the Principles of Natural Language, Logic and Statistics Lab within the Computer Science Department at University College London. My research focuses on the intersection of quantum computing and AI, specifically exploring the quantum phenomenon of contextuality and its potential applications in natural language processing (NLP).

Another derivation for "Obtaining logprobs from an LLM API"

OpenAI has modified their API to return the log probabilities before any logit bias is applied. Hence the methods described in this article are no longer applicable. The aim of this article is to provide an alternative derivation of the results in Mattew Finlayson’s article Obtaining logprobs from an LLM API. Most LLM APIs return the logprobs of only the top-$ k $ predictions. The value of $ k $ is often small, in the order of 10....

June 17, 2024 · 7 min · Kin Ian Lo

Notes on Statistics

Hypothesis Testing In scientific research, we often want to prove that a certain statistical phenomenon is true. For example, we might want to prove (or rather show that it is likely) that a coin is unfair (that it lands on heads and tails with unequal probabilities). We do this by flipping the coin $N$ times and recording the number of heads $N_h$ and the number of tails $N_t$. For example, we may get $N_h = 40$ and $N_t = 60$, which sum to $N = 100$....

February 12, 2023 · 6 min · Kin Ian Lo

Writing LaTex maths in markdown

Since I started blogging, I have been using markdown to write my posts. Due to the nature of the topics I write about, I often need to write maths using LaTex. Initially, I had been using kramdown as the markdown parser since it has a built-in math syntax. Essentially, kramdown recognises anything in between $$ and $$ as LaTex code and not markdown. That means 1,y in $$(x_1, y_1)$$ is not interpreted as italics or bold....

February 9, 2023 · 4 min · Kin Ian Lo

Notes on binary search

Binary search is a essential algorithm used in coding interview. It is used to search for an target element x in a sorted list a: list with a time complexity O(log(n)). The naive way to search for x in a is to iterate through the list and check if a[i] == x for every i in range(len(a)). The time complexity of such an naive approach is O(n). However, if the list is not sorted, we can sort it first sort it first with a time complexity of O(nlog(n)) and then followed by a binary search....

October 17, 2022 · 5 min · Kin Ian Lo