The Challenge of Technical Search
Finding relevant technical papers and code efficiently is a persistent challenge for researchers and developers. Traditional keyword search, while useful, often misses relevant results due to variations in terminology, synonyms, or conceptual overlap. Semantic search, powered by embeddings, can bridge this gap by understanding the meaning behind queries and documents, but implementing a robust, scalable semantic search system can be complex and resource-intensive.
Papers with Code faced this exact dilemma when seeking to enhance its search capabilities. The goal was to create a system that leveraged the strengths of both keyword and semantic search, offering a more comprehensive and accurate retrieval experience for its vast repository of technical content. This led to the development of a sophisticated search engine built upon open-source components, demonstrating that state-of-the-art performance is achievable without proprietary solutions.
Core Components: PostgreSQL, pgvector, and Qwen3
The technical backbone of this enhanced search engine relies on a combination of mature and specialized tools. At its heart is PostgreSQL, a powerful and reliable relational database system. The key to its semantic search capability comes from the pgvector extension, which enables PostgreSQL to store and query vector embeddings efficiently. This allows for similarity searches directly within the database, eliminating the need for separate vector databases in many scenarios.
For generating the text embeddings, Papers with Code selected Qwen3-Embedding-0.6B. This model provides a strong balance of performance and efficiency for creating dense vector representations of text. The choice of a 0.6B parameter model suggests a focus on achieving high-quality embeddings without the extreme computational overhead of larger models, making it suitable for large-scale applications. The integration of Qwen3 embeddings with pgvector means that semantic similarity queries can be executed with high performance directly against the PostgreSQL database.

Infrastructure and Workflow for Embedding Generation
Generating embeddings for a large corpus of documents is a computationally intensive task. Papers with Code utilized Hugging Face Jobs, a platform that orchestrates machine learning workloads, to manage this process. These jobs were run on NVIDIA L4 GPUs, providing the necessary hardware acceleration for efficient batch embedding generation. This setup allows for parallel processing of documents, significantly speeding up the ingestion and updating of the search index.
Storage of the generated embeddings and other artifacts is handled by Hugging Face Buckets, a cloud-based object storage solution. This provides a scalable and cost-effective way to manage the large amounts of data associated with embeddings. For serving the embedding model in real-time, a Hugging Face Inference Endpoints solution was deployed. This enables the system to generate embeddings for new or updated documents on demand, ensuring the search index remains current without requiring constant batch processing.
The Power of Hybrid Search
The most significant advancement in the Papers with Code search engine is its implementation of a hybrid search strategy. By combining traditional keyword search with semantic search powered by Qwen3 embeddings and pgvector, the system achieves superior results compared to using either method in isolation. Keyword search excels at exact matches and specific technical terms, while semantic search captures conceptual relevance and nuances in language.
When a user submits a query, the system can execute both types of searches. The results from each are then combined and re-ranked. This hybrid approach ensures that users find documents that are not only textually similar to their query but also conceptually aligned, leading to a more comprehensive and satisfying search experience. This is particularly crucial in technical domains where precise language and conceptual understanding are paramount.
Implications for Technical Search Systems
The success of Papers with Code in building a state-of-the-art search engine using readily available open-source tools has broad implications. It demonstrates that powerful semantic search capabilities are accessible to organizations of all sizes, not just those with massive R&D budgets for proprietary solutions. The use of PostgreSQL with pgvector offers a compelling alternative to dedicated vector databases, potentially simplifying architecture and reducing operational costs by consolidating data and search functionalities within a single, familiar database system.
The choice of Qwen3-Embedding-0.6B highlights the increasing maturity and effectiveness of smaller, more efficient embedding models. These models provide a viable path for achieving high-quality semantic search without the prohibitive computational requirements of their larger counterparts. This trend democratizes access to advanced AI capabilities, enabling more developers and companies to integrate sophisticated search and recommendation features into their applications.
What remains to be seen is how this approach scales with even larger, more diverse datasets and the potential for adversarial inputs that might exploit the semantic understanding. However, the foundational architecture presented by Papers with Code offers a robust blueprint for building next-generation search experiences.
