I made the nine-hour drive from Virginia to Oakland to begin the program and quickly settled in after meeting the other interns. We’ve already had many thoughtful and engaging conversations over lunch, which has helped build a strong sense of community. I started working in Dr. Hanna’s lab and soon came across a fascinating paper by Gligoroski et al. on cryptography over public chat channels. Their work inspired the direction of my research—I’m now focused on building upon their framework to enhance its security, particularly by improving resistance to known-position attacks.
This week, I began implementing equivalence classes into Gligoroski et al.’s cryptographic embedding framework. These classes are formed by grouping characters such that each class has an equal cumulative probability, using a greedy balancing heuristic to achieve this distribution. By embedding characters from equivalence classes rather than individual letters, we ensure that the entire alphabet is represented in a statistically balanced way. This not only preserves the naturalness of the generated text but also strengthens the framework’s security—making it more resistant to known-position attacks by obscuring patterns in character placement.
Now that I had developed an algorithm capable of generating equivalence classes of any size, the next challenge was ensuring that the frequency of embedded characters remained consistent with normal English text. For instance, in a long message, common letters like “E” occur much more frequently than rare ones like “Q,” and I needed to prevent this imbalance from skewing the distribution of the equivalence class characters. As outlined in my paper, this required constructing an optimal prefix-free mapping for π₁. To achieve this, I designed a search algorithm that identifies a locally optimal encoding, balancing character frequencies to preserve natural language statistics while maintaining the integrity of the cryptographic embedding.
This week, I heard back from Dr. Gligoroski, who clarified that my framework should be designed to embed binary inputs rather than strings of characters. In retrospect, this makes much more sense—messages need to be encrypted before embedding, and most modern ciphers operate on binary data. With this insight, I began restructuring my paper to reflect the updated design. I also met Joey in Dr. Hanna’s lab, who expressed interest in collaborating on the project. Together, we began developing code that uses GPT-2 to filter the top-k tokens based on specific constraints, laying the groundwork for the embedding algorithm. I also got some much-needed help cleaning up my VS Code environment. (See image to the left.)
Joey and I have now implemented Gligoroski et al.'s proposed algorithm using both GPT-2 and LLaMA 3B via HuggingFace. Building on this foundation, we are currently developing our own embedding algorithm that leverages equivalence classes to improve security and token selection. Additionally, Joey proposed a novel tree-based embedding approach that I am excited to explore further. By using a tree structure to track token paths during generation, this method allows us to backtrack and search for optimal sequences—avoiding the need to artificially increase the model’s temperature, which can degrade the semantic coherence of the output.
Now that Joey and I have a working algorithm capable of successfully embedding messages, we decided to pivot toward evaluating the framework’s security by exploring potential attacks. Our goal is to proactively identify and address any weaknesses by attempting to break our own system. I began by analyzing the frequency analysis attack, where an adversary knows the exact positions of the embedded characters. Joey conducted a statistical analysis using a large dataset of generated messages, while I focused on writing a formal proof demonstrating that the frequency distribution of embedded characters is indistinguishable from natural English. In the end, we were both successful—our combined analysis showed that frequency analysis is ineffective against our framework. On a lighter note, I also brought a plant into the lab this week and decorated him with arms and paper eyes, adding some personality to our workspace.
This week, I was unfortunately very sick and wasn’t able to get as much done as I had hoped. However, Joey and I began exploring additional attacks, including a variant of the token rank attack where an adversary plots the ranks of every token to identify consistently higher ranks at known embedding locations. We discovered that our framework is currently very vulnerable to this kind of analysis. Moving forward, we plan to investigate methods to reduce the effectiveness of token rank attacks, although we’re still determining the best approach.
This week, I continued our analysis of the token rank attack. To improve token selection, we implemented a more inclusive strategy: instead of adding only embedded tokens to the tree, we also included short padding tokens as children when available. This allowed the algorithm to explore a wider range of options and avoid making hasty or forced selections. As a result, the average token rank of embedded tokens decreased, improving both the stealth and coherence of the generated text.
This week, I spent most of my time preparing my research poster for the MidSure conference. I focused on creating a clean, engaging design with large text and graphics that could be easily understood from a distance, while including more detailed explanations along the sides for those who wanted to dive deeper. I designed the main diagram of our framework in Canva and used Procreate to hand-illustrate some of the supporting visuals. In parallel, I finalized our analysis of token rank attacks by generating a dataset of 250 messages using our optimized embedding algorithm. I then visualized the results, which clearly showed that our improvements significantly reduced the ranks of embedded tokens—making them blend more naturally with the language model’s output.
This week, I had the opportunity to present my research at Michigan State University's MidSure conference. It was incredibly rewarding to share my work with a broader audience, and I felt proud seeing my poster displayed alongside so many impressive projects. The feedback I received was encouraging, and it helped reinforce how much progress I’ve made over the summer. As the program comes to a close, I’m now finishing up all of my final deliverables, including my project Google Site, a condensed summary report of my research, and the required NSF surveys. It’s been a busy but fulfilling conclusion to an exciting and productive summer.