Abstract
AI systems are quickly becoming integrated into personal life, the workplace and even the public sector. Concerningly, their internal mechanisms remain opaque even to the engineers who build them. I investigate prompt engineering techniques to improve the performance of SLMs for KQL code generation. Prompt engineering is a low-cost and effective strategy to improve model accuracy and SLMs are cheaper and more efficient than LLMs; together, these strategies are resource efficient and cost-effective ways to increase model performance. I analyze the origins and persistence of opacity in AI algorithms. Opacity is the characteristic of ML algorithms that makes them inexplicable to humans and results in them being a black box technology. Opacity makes prompt engineering necessary: developers cannot consistently predict how minute changes to a prompt may result in drastic changes in outputs. Prompt engineering is an attempt to standardize methods that have been shown to improve model performance by changing how inputs are formatted.
Prompt engineering offers a lightweight alternative to finetuning for optimizing small language models (SLMs). In my technical report, I investigate the effectiveness of several zero-shot prompt engineering strategies, such as chain of thought, prompt chaining, tree of thoughts, and automatic prompt engineer (APE), for translating natural language queries (NLQs) into Kusto Query Language (KQL) code. Using a dataset of 230 NLQ-KQL pairs within the Microsoft Defender Schema, outputs were evaluated on syntax accuracy (runnable code) and semantic accuracy (correct table and column usage).
Results show that syntax scores were consistently high across methods, while semantic scores remained low without explicit schema information. Incorporating schema information improved semantic accuracy while reducing syntax scores, reflecting challenges in handling long context inputs. Among tested techniques, chain of thought with schema achieved the best balance between syntax and semantic performance, while APE optimized for syntax at the expense of semantic correctness. These findings highlight the trade-off between syntactic and semantic accuracy in schema-aware prompting. Future work should explore embedding-based schema retrieval and the integration of larger models into the APE framework.
In my STS paper, I investigate the origins of opacity, its persistence today, and impacts it has on how society perceives AI. Opacity prevents humans from understanding how the model arrived at a decision or output; this facilitates hidden biases and reduces the legitimacy of the decision. This is particularly important as AI is being used across industries, including the public sector, potentially serving as an inhibitor of transparency and fairness. I analyze this question by dividing it into three parts: I analyze the origins of opacity through a historical analysis of the development of machine learning, examining computer science literature of the era. I investigate the persistence of opacity today by analyzing the actor network of AI algorithms to see what factors and relationships influence opacity. Finally, I apply media analysis techniques to identify how AI is portrayed in the media and evaluate other impacts of opacity on society.
I found that opacity developed in machine learning to differentiate it from other techniques due to competition for funding and the power to define what AI is. ML ultimately won the competition; the term is synonymous with AI today. Even though opacity developed to distinguish it from other techniques, it persists today because it is beneficial for AI companies, who now have the strongest influence on the technology. One such benefit to AI companies is AI hype. Opacity makes the technology appear as a black box, creating inflationary views of the technology. This is seen in hyperbolic media reporting on ML and in Google search trends for AI. Opacity is an important issue regarding AI use because it covers hidden biases in models and when used in the public sector, it prevents governments from upholding the values of transparency and fairness.