mlsanityData to 13 Oct 2026

TASTY: A Transformer based Approach to Space and Time complexity

arXiv 2305.05379 ↗First posted 6 May 2023cs.SE cs.LGcited by 3

Not on the map. Why?

Abstract (arXiv)

Code based Language Models (LMs) have shown very promising results in the field of software engineering with applications such as code refinement, code completion and generation. However, the task of time and space complexity classification from code has not been extensively explored due to a lack of datasets, with prior endeavors being limited to Java. In this project, we aim to address these gaps by creating a labelled dataset of code snippets spanning multiple languages (Python and C++ datasets currently, with C, C#, and JavaScript datasets being released shortly). We find that existing time complexity calculation libraries and tools only apply to a limited number of use-cases. The lack of a well-defined rule based system motivates the application of several recently proposed code-based LMs. We demonstrate the effectiveness of dead code elimination and increasing the maximum sequence length of LMs. In addition to time complexity, we propose to use LMs to find space complexities from code, and to the best of our knowledge, this is the first attempt to do so. Furthermore, we introduce a novel code comprehension task, called cross-language transfer, where we fine-tune the LM on one language and run inference on another. Finally, we visualize the activation of the attention fed classification head of our LMs using Non-negative Matrix Factorization (NMF) to interpret our results.

Key facts. Cited by 3 papers in the map (data through 13 Oct 2026). Builds on 18 of its 31 references that are in the map. First posted on arXiv 6 May 2023.

Builds on

18 of 31 references.

References · 18

  1. 2017Attention Is All You Needcited by 60,106
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,304
  3. 2014Adam: A Method for Stochastic Optimizationcited by 37,093
  4. 2020Language Models are Few-Shot Learnerscited by 32,320
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,549
  6. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,360
  7. 2020Longformer: The Long-Document Transformercited by 3,393
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,304
  9. 2017Mixed Precision Trainingcited by 1,147
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 905
  11. 2016Training Deep Nets with Sublinear Memory Costcited by 840
  12. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 651
6 more
  1. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  2. 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 361
  3. 2021Retrieval Augmented Code Generation and Summarizationcited by 148
  4. 2019Learning based Methods for Code Runtime Complexity Predictioncited by 5
  5. 2022End-to-end Multiple Instance Learning with Gradient Accumulationcited by 4
  6. 2019An empirical estimation for time and memory algorithm complexities: newly developed R packagecited by 1

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 2.

3 papers.