Relation between a recommender and a PhD applicant Online PhD application systems usually ask for relation between the recommender and the applicant.

The applicant was in a PhD program and the recommender was a professor in the department. The applicant approached him for some research opportunities at first, and later did some research in one of the recommender's projects, directly mentored by an assistant research professor. There was no formal title of "research adviser" for the recommender to the applicant, or for the research assistant professor to the applicant, as the student was still in the process of finalizing research direction and adviser. The student then didn't finish the PhD, and later applied to PhD programs in other universities.

Can the relation between the recommender and the applicant be "research adviser" in PhD application? What is best to describe that relation? 
By the way, the recommender was also an instructor to the applicant in some courses. But a relation besides "instructor" was preferred, if possible.
You may consider two roles for the students in previous institute; one as a PhD student looking for topic and the other is a short-term research collaborator. As the recommender was not engaged in your PhD job, he cannot be PhD advisor. 

However, since the recommender was primary investigator (or head) of the project student worked in, the relationship is research collaborator or more focused, primary investigator in a collaborative research. Your output of the collaborative research with him as technical report, conference paper, or journal article would prove the relationship.

But I think student needs to convince the new graduate school that why did he fail/dismiss previous PhD.