Software Engineering Event Modeling using Relative Time in Temporal Knowledge Graphs

Kian Ahrabian, Daniel Tarlow, Hehuimin Cheng, Jin L. C. GuoarXiv 2020

TL;DR

This paper introduces a new way to model software engineering events on platforms like GitHub using temporal knowledge graphs (TKGs). They propose a novel method, RT-DE-ROTATE, that leverages "relative time" to better predict future events, outperforming existing models, especially in challenging "extrapolated" scenarios.

What Problem Does This Paper Address?

Software development platforms like GitHub generate a massive amount of temporal data – think issue creation, pull request merges, code commits, and comments. Researchers want to use this data to answer crucial questions, such as "When will this issue be closed?" or "Who should review this code?". Traditional knowledge graph (KG) embedding methods, even temporal ones, struggle with these questions, particularly when predicting events far into the future (extrapolation) or when the exact timing is critical. The core challenge is that simply knowing when an event happened isn't as informative as knowing how long ago it happened relative to other events.

Methods

The authors build upon existing temporal KG embedding techniques, specifically focusing on models that can handle time-varying relationships. Their key innovation is the Relative Time DE-Rotate (RT-DE-ROTATE) model. Inspired by the success of relative positional encodings in Transformer models (like those used in natural language processing), RT-DE-ROTATE incorporates information about the time elapsed since previous relevant events.

Instead of just using the absolute timestamp of an event, RT-DE-ROTATE considers a vector of "relative temporal contexts" for each entity. This context captures how long it has been since the last interaction of a specific type involving that entity. This allows the model to learn patterns like "if a pull request has been open for X days and has Y comments, it's likely to be closed soon," which is more powerful than just knowing the absolute date it was opened.

Datasets

The paper introduces two new datasets derived from GitHub's public event archive for the year 2019:

  • GITHUB-SE 1Y: A comprehensive dataset representing a full year of GitHub interactions.
  • GITHUB-SE 1Y-REPO: A sampled subset of GITHUB-SE 1Y, focusing on a specific repository to reduce computational demands while retaining rich temporal information.
  • GITHUB-SE 1M-NODE: Another sampled subset, created using a snowball sampling strategy to preserve informative nodes across various projects, useful for answering queries about user contributions over time.

These datasets are designed to specifically test time-conditioned link prediction and time prediction queries, including challenging extrapolated scenarios.

Key Insights and Ideas

  • Relative Time is Crucial for SE: The most significant insight is that for software engineering tasks, the relative timing of events is often more predictive than absolute timestamps. Knowing "how long ago" something happened provides critical context for predicting future outcomes.
  • Existing Temporal KGs Fall Short on Extrapolation: The paper clearly demonstrates that current state-of-the-art temporal KG embedding models struggle significantly when asked to predict events far into the future or when the query time is beyond the observed data range.
  • Transformer-Inspired Relative Encoding Works for KGs: The success of relative positional encodings in sequence modeling translates well to temporal knowledge graphs, offering a promising avenue for improving temporal reasoning.
  • GitHub Data is Rich for SE Event Modeling: The newly created datasets highlight the potential of using rich, real-world software development interaction data to build sophisticated predictive models for software engineering.

Key Results

  • Improved Extrapolated Link Prediction: RT-DE-ROTATE showed a significant performance boost on the GITHUB-SE 1Y-REPO dataset for extrapolated time-conditioned link prediction queries, outperforming existing models like RotatE and DE-X. For instance, on this dataset, RT-DE-ROTATE achieved a notable improvement in HITS@1 and MRR for extrapolated scenarios.
  • Competitive Performance on Interpolated Queries: While the gains were less dramatic, RT-DE-ROTATE also performed competitively or slightly better than existing models on interpolated queries.
  • Time Prediction Challenges Remain: The paper notes that even with their proposed method, time prediction queries (predicting the exact time of an event) remain challenging, though RT-DE-ROTATE showed marginal improvements over baselines.

Limitations and Future Work

  • Computational Cost: While RT-DE-ROTATE offers improved performance, it does introduce some additional computational complexity due to the relative temporal context. The authors note that their extension does not linearly increase free parameters, which is a bottleneck for large KGs.
  • Extrapolation Still Difficult: Despite improvements, extrapolated time prediction remains a difficult problem, suggesting further research is needed.
  • Future Directions: The authors suggest exploring more sophisticated ways to leverage relative temporal information and potentially combining their approach with other advanced KG embedding techniques. They also highlight the need for further studies specifically on extrapolated time prediction queries.

Summary updated

BibTeX
@misc{ahrabian2020software,
  author = {Kian Ahrabian and Daniel Tarlow and Hehuimin Cheng and Jin L. C. Guo},
  title = {{Software Engineering Event Modeling using Relative Time in Temporal Knowledge Graphs}},
  year = {2020},
  eprint = {2007.01231},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.01231},
}
Figure