Learning what to share between loosely related tasks