AGAnshul Garg

Anshul Garg

*This is an algorithmically generated author record based on publicly available information.

Anshul Garg has a total of 5 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    Learning Execution Plan Embeddings for Multi-Dimensional Query Resource Prediction

    by Mahendran Vasagam, Ashok Kumar, Anshul Garg

    Multi-cluster query engines are common in production, but routing queries to appropriately-sized clusters remains an unsolved problem. Current approaches like round-robin, hash-based routing, or manual rules waste resources when simple queries land on oversized clusters and cause failures when complex queries hit undersized ones. Production systems experience resource mismatch failures, requiring manual workarounds such as migrating problematic queries to separate engines. We address this with a system for intelligent cluster sizing using learned execution plan embeddings to predict query resource requirements. Instead of analyzing query text, we vectorize execution plan structure and search for similar historical queries, predicting memory, Central Processing Unit (CPU) and runtime based on actual past performance rather than unreliable optimizer estimates. We employ a tiered inference strategy that supports fast, feature-based vectors (10 basic dimensions; 13–23 ms overhead), gradient boosting with enhanced features (24 dimensions; 76.5% accuracy), and graph neural network embeddings for complex queries (78.1% accuracy). An adaptive classifier maps predictions to cluster sizes using thresholds that adjust based on observed utilization patterns. Unfamiliar queries are routed conservatively, and the system automatically improves from observed outcomes. Empirical validation on 2,954 queries from a Trino deployment shows 98.8–99.8% within-one-size accuracy and 74.8–76.5% exact-match routing. In benchmark workloads, our approach reduces out-of-memory failures by 82% and infrastructure costs by 33%, with less than 51 ms of routing overhead. Gradient boosting achieves 76.5% accuracy, while graph neural networks reach 78.1% for complex join structures.


  • Red-Team Prompt Injection Defense Using Multi-Context Protocol (MCP)

    by VasanthRao Jadav, Shravya Bussari, Mukesh Aurangabadkar, Anshul Garg

    Prompt injection attacks represent a critical security risk in Large Language Model (LLM)–powered applications, enabling adversaries to manipulate model behavior, bypass safety controls, and trigger unauthorized actions. Existing defenses predominantly rely on prompt hardening or output filtering, which remain brittle against adaptive and indirect attack techniques. This paper introduces a red-team–driven defense framework based on a Multi-Context Protocol (MCP) that enforces strict isolation and validation of prompt layers. MCP separates system, developer, retrieval, and user prompts into independently trusted contexts and applies context validation, version control, semantic consistency checks, and input reputation scoring prior to model inference. Through empirical evaluation using representative prompt injection attacks, the proposed approach demonstrates a significant reduction in successful injection attempts while preserving low latency and minimal false positives. The framework is model-agnostic and designed for secure deployment in enterprise and regulated LLM environments.